ADSM-L

Re: Automatic start/restart of dsmc/dsmserv - Solaris

1998-06-04 10:13:59
Subject: Re: Automatic start/restart of dsmc/dsmserv - Solaris
From: Shira Hayun <shira AT TLV.IEC.CO DOT IL>
Date: Thu, 4 Jun 1998 17:13:59 +0300
Steffan Rhoads wrote:
>
> I use a script containg:
> echo "/pathtoadsmcfgfiles/rc.adsm[serv|bac]"|at now
>
> Use your path and script file name and pass to the 'at' command.
>
> Al Cheski wrote:
>
> > Howdy, I have implemented a new ADSM V3 Solaris server and found some nice
> > online manuals to read. In the UNIX backup-Archive Client manual on page
> > 10, it shows how to start dsmc sched from inittab. There is a note there
> > that says starting it from /sbin/rc2.d/xxx is not possible. But, that is
> > how I currently do it...so why is it not possible? Also, if I change
> > dsm.sys or dsm.opt and want to restart dsmc sched to pick up the changes,
> > how do I do it from inittab, I don't think I can. Finally, the ADSM Server
> > Admin guide indicates that dsmserv can be started by using nohup dsmserv
> > -quiet &. I do this from an rc script so it starts ADSM at boot time. Does
> > anybody know the correct way to start/stop these processes at system
> > boot/halt time? Also, I still have the problem where starting dsmc sched
> > from a shell and then doing ctrl-c or exiting the shell causes dsmc sched
> > to die...I have tried nohup, etc but can't prevent this from happening.
> > Anybody found a way around this fun little problem?
> >
> > Al Cheski
> > Gulf Canada Resources
>
> --
> Steffan Rhoads
> Lead Technical Consultant
> Think Enterprise Solutions
> 10 Holland
> Irvine, California  92618-2504
> srhoads AT westernmicro DOT com
>
>     ---------------------------------------------------------------
>
>                               Name: vcard.vcf
>              Part 1.2         Type: text/x-vcard
>                           Encoding: 7bit
>                        Description: Card for Steffan Rhoads


Hello,

The Sun Solaris has the following start/halt procedure:

You put your base script in /etc/init.d/, and you have to link it to
/etc/rc2.d/<file name begins with S> and to /etc/rc0.d/<file name begins
with K>.

When the solaris is comming up, it looks for files in the /etc/rc2.d
directory that begins with the letter S, and execute them with the
parameter "start". When it is being halted, it is looking for files in
the /etc/rc0.d that starts with K and execute them with the parameter
"stop".

I don't know of a way to automaticly restart sessions with the Solaris
system.


The script I use is:
-------------------
case "$1" in
case "$1" in
'start')
        if [ -f /usr/bin/dsmc ]
        then
                /usr/bin/dsmc sched  >/dev/null 2>&1 &
                /usr/bin/dsmc sched -machine=sun5m -password=sun5m
>/dev/null 2>
&1 &
        fi
        ;;
'stop')
        PID=`/usr/bin/ps -e -u 0|/usr/bin/fgrep dsmc |/usr/bin/awk
'{print $1}'`

        if [ ! -z "$PID" ] ;  then
                /usr/bin/kill ${PID} 1>/dev/null 2>&1
        fi
        ;;
*)
        echo "Usage: /etc/init.d/adsmsched { start | stop }"
        ;;
esac
exit 0