#!/bin/sh # # Taken from https://www-304.ibm.com/support/docview.wss?uid=swg21358414 # start and stop the client daemon for a node # Fixed so multiple could be run at once # # To create a new node # 1. Create the node definition in the dsm.sys # 2. Create an opt file called .opt # 3. Copy this file to /etc/init.d/dsmcad- # 4. chkconfig --add dsmcad- # 5. service dsmcad- start # # chkconfig: 345 93 35 # description: Starts and stops TSM client acceptor daemon # # added new chkconfig ### BEGIN INIT INFO # Provides: # Required-Start: $local_fs $network $remote_fs $autofs # Required-Stop: $local_fs $network $remote_fs $autofs # Default-Start: 3 4 5 # Default-Stop: 0 1 2 6 # Short-Description: TSM infr Instance # Description: Tivoli Storage Manager Infrastructure Instance ### END INIT INFO #Source function library. . /etc/rc.d/init.d/functions [ -f /opt/tivoli/tsm/client/ba/bin/dsmc ] || exit 0 [ -f /opt/tivoli/tsm/client/ba/bin/dsmcad ] || exit 0 prog="dsmcad" service=`basename $0` # see if $0 starts with Snn or Knn, where 'n' is a digit. If it does, then # strip off the prefix and use the remainder as the instance name. if [[ ${service:0:1} == S ]] then service=${service#S[0123456789][0123456789]} elif [[ ${service:0:1} == K ]] then service=${service#K[0123456789][0123456789]} fi node=${service#dsmcad-} pidfile=/var/run/${service}.pid export DSM_DIR=/opt/tivoli/tsm/client/ba/bin export DSM_CONFIG=/opt/tivoli/tsm/client/ba/bin/$node.opt # To not skip unrecognized characters during sched or web client backups export LANG=en_AU export LC_ALL=en_AU start() { echo -n $"Starting $prog for tsm node $node: " cd $DSM_DIR daemon $DSM_DIR/dsmcad -optfile=$DSM_CONFIG echo # echo daemon $DSM_DIR/dsmcad RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$service && ps -fe |grep -v grep |grep "$DSM_DIR/dsmcad -optfile=$DSM_CONFIG" |awk '{print $2}' > $pidfile return $RETVAL } stop() { if [ -f $pidfile ] ; then echo -n $"Stopping $prog for tsm node $node: " killproc -p $pidfile $prog # echo killproc dsmcad echo else echo -n "$service not running" echo fi RETVAL=$? [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$service && rm -f $pidfile return $RETVAL } case "$1" in start) start ;; stop) stop ;; status) status -p $pidfile $prog ;; restart) stop start ;; condrestart) if [ -f /var/lock/subsys/$service ] ; then stop start else echo "$service not running" fi ;; *) echo $"Usage: $0 {start|stop|restart|condrestart|status}" exit 1 esac exit 0