INIT Script for Tivoli Storage Manager
Novell Cool Solutions: Tip
By Cameron Seader
Digg This -
Slashdot This
Updated: 23 Aug 2007 |
Application:
The Tivoli Storage Manager client acceptor daemon does not come with any kind of INIT script for SUSE Linux Enterprise, so if you are in need of one you can use the following script here.
Explanation:
This INIT script is provided to start the Tivoli Storage Manager client acceptor daemon on SUSE Linux Enterprise.
Script:
Copy the text below into a file preferably named dsm or download it here.
#!/bin/sh ### BEGIN INIT INFO # Provides: dsm # Required-Start: $network $syslog $remote_fs # Required-Stop: $network $syslog $remote_fs # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: Tivoli Storage Manager client acceptor daemon ### END INIT INFO # Check for existence of Binaries DSMC_BIN=/opt/tivoli/tsm/client/ba/bin/dsmc DSMCAD_BIN=/opt/tivoli/tsm/client/ba/bin/dsmcad test -x $DSMC_BIN || { echo "$DSMC_BIN not installed"; if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; } test -x $DSMCAD_BIN || { echo "$DSMCAD_BIN not installed"; if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; } prog1="dsmcad" prog2="dsmc" export DSM_DIR=/opt/tivoli/tsm/client/ba/bin export DSM_CONFIG=/opt/tivoli/tsm/client/ba/bin/dsm.opt DSMCAD_PIDFILE=/var/run/dsmcad.pid DSMC_PIDFILE=/var/run/dsmc.pid . /etc/rc.status # First reset status of this service rc_reset case "$1" in start) echo -n $"Starting $prog2: " startproc -f -p $DSMC_PIDFILE $DSMC_BIN sched >/dev/null 2>/dev/null rc_status -v echo -n $"Starting $prog1: " startproc -f -p $DSMCAD_PIDFILE $DSMCAD_BIN >/dev/null 2>/dev/null rc_status -v ;; stop) echo -n $"Stopping $prog2: " killproc -p $DSMC_PIDFILE -TERM $DSMC_BIN rc_status -v echo -n $"Stopping $prog1: " killproc -p $DSMCAD_PIDFILE -TERM $DSMCAD_BIN rc_status -v ;; restart) $0 stop $0 start rc_status ;; status) echo -n "Checking for DSMC" checkproc $DSMC_BIN rc_status -v echo -n "Checking for DSMCAD" checkproc $DSMCAD_BIN rc_status -v ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 ;; esac rc_exit
Once you have this shell script created you can save it in /etc/init.d/ with chmod 755 permissions on it. Then you can issue a chkconfig dsmcad so that it inserts it into the proper runlevels in the right spot. Also, if you want to check it you can run chkconfig dsm on, and also check the corresponding /etc/init.d/rcx.d directory for the link that it would have created.
Enjoy!!

Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com