Article

INIT Script for Tivoli Storage Manager

article
Reads:

2679

Score:
3
3
1
 
Comments:

1

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

. /etc/rc.status

# First reset status of this service
rc_reset

case "$1" in
  start)
    echo -n $"Starting $prog2: "
    startproc $DSMC_BIN sched >/dev/null 2>/dev/null
    rc_status -v
    echo -n $"Starting $prog1: "
    startproc $DSMCAD_BIN  >/dev/null 2>/dev/null
    rc_status -v
    ;;
  stop)
    echo -n $"Stopping $prog2: "
    killproc -TERM $DSMC_BIN
    rc_status -v
    echo -n $"Stopping $prog1: "
    killproc -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!!





User Comments

scripts linked and displayed are a bit different.

Submitted by mrjcoopdk on 23 July 2009 - 6:34am.

Hello.
The script displayed on the page and the one linked to are slightly different.

© 2009 Novell, Inc. All Rights Reserved.