Automatic startup of dsmcad daemon on system reboot on Red Hat Linux

Technote (troubleshooting)


Problem(Abstract)

Automatic startup of daemon on Red Hat Linux may be done by adding an entry in /etc/inittab or via /etc/rc.d script which is executed by the init command at boot time or when changing runlevel. A sample configuration is provided in here.

Resolving the problem

The following discussion assumes that theTivoli Storage Manager client client acceptor daemon is responsible for the scheduler and for web client. If it is necessary to control them separately, another script in /etc/init.d would have to be created in the same way as described below, then managedservices option should be adjusted accordingly.
1. Log in as the root user

2. Change to the /opt/tivoli/tsm/client/ba/bin directory

3. Use dsm.sys.smp as the template to create dsm.sys file. Here is an example below which assumes the client node name is tsmlinux and server hostname is tsmserver (must be in /etc/hosts or DNS):

SErvername mytsm
COMMmethod TCPip
TCPPort 1500
TCPServeraddress tsmserver
managedservices webclient schedule
httpport 1581
webports 1582 1583
nodename tsmlinux
passwordaccess generate
errorlogname /var/log/dsmerror.log
schedlogname /var/log/dsmsched.log
errorlogretention 365,S
schedlogretention 365,S

4. Use dsm.opt.smp as template to create dsm.opt file. Here is an example below which follows previous example :

SERVERNAME mytsm

5. Optional. If the RedHat firewall is enabled, use the /etc/sysconfig/redhat-config-securitylevel tool to add the appropriate ports to it. In the above example, the ports would be 1500, 1581, 1582 and 1583. The /etc/sysconfig/redhat-config-securitylevel file would therefore have those additional ports listed, i.e,

--port=1500:tcp
--port=1581:tcp
--port=1582:tcp
--port=1583:tcp

Once this is done, configure the client to start from boot using one of the below methods either using the inittab or an init.d script. Either method is valid and choosing one method over the other depends on your system configuration and operational preference. For example, if you use the default installation and options file in default location, using the inittab is suitable. If you have options file in specific locations, it would be necessary to export the DSM_CONFIG environment variable and an init.d script would then be preferable. Also, if you prefer to use the Linux service command to control daemons, then, the init.d script is needed.

Method A Using the inittab

Add the following entry to the /etc/inittab :

cad::once:/opt/tivoli/tsm/client/ba/bin/dsmcad >/dev/null 2>&1 # TSM Webclient

Please see technote 1624682 for additional information regarding /etc/inittab and RHEL 6.

Method B Using an /etc/init.d script

On a Redhat linux system, adding corresponding scripts for the Tivoli Storage Manager client acceptor daemon, dsmcad, is a standard way to perform necessary administrative tasks like starting, stopping or restarting dsmcad and/or dsm scheduler using standard linux service start/stop/restart for automatic or manual operations. The below procedure may be used to configure dsmcad in such a way.

a. Create the following script file /etc/init.d/dsmcad:

#!/bin/sh
#
# chkconfig: - 91 35
# description: Starts and stops TSM client acceptor daemon
#
#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"

export DSM_DIR=/opt/tivoli/tsm/client/ba/bin
export DSM_CONFIG=/opt/tivoli/tsm/client/ba/bin/dsm.opt

start() {
echo -n $"Starting $prog: "
cd $DSM_DIR
daemon $DSM_DIR/dsmcad
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dsmcad
return $RETVAL
}

stop() {
if test "x`pidof dsmcad`" != x; then
echo -n $"Stopping $prog: "
killproc dsmcad
echo
fi
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dsmcad
return $RETVAL
}

case "$1" in
start)
start
;;

stop)
stop
;;

status)
status dsmcad
;;
restart)
stop
start
;;
condrestart)
if test "x`pidof dsmcad`" != "x"; then
stop
start
fi
;;

*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1

esac

exit 0


b. Setup permissions to execute for /etc/init.d/dsmcad file (at least for root user), i.e,

chmod 744 /etc/init.d/dsmcad

c. Create the various links for the runlevels intended. This can be done manually or via the "chkconfig" linux command.

If using the /sbin/chkconfig command,

  • Add dsmcad
    # /sbin/chkconfig --add dsmcad
  • Start dsmcad in runlevels 3 and 5 only
    # /sbin/chkconfig --level 35 dsmcad on
  • Verify what runlevels are enabled for dsmcad
    # /sbin/chkconfig --list dsmcad

This will create the various symbolic links in the proper rc*.d directories based on the runlevels provided.

If done manually, create the following links in directories rc3.d, rc5.d, rc0.d, rc6.d, rc1.d:

# cd /etc/rc.d/rc3.d
# ln -s ../init.d/dsmcad S91dsmcad

# cd /etc/rc.d/rc5.d
# ln -s ../init.d/dsmcad S91dsmcad

# cd /etc/rc.d/rc0.d
# ln -s ../init.d/dsmcad K35dsmcad

# cd /etc/rc.d/rc6.d
# ln -s ../init.d/dsmcad K35dsmcad

# cd /etc/rc.d/rc1.d
# ln -s ../init.d/dsmcad K35dsmcad

The above is valid for default Redhat linux workstation setting, assuming that default init level is 5 or 3; Check default init setting in /etc/inittab, it should be like:

id:5:initdefault

Adjust the above procedure if necessary

The above procedure will allow dsmcad to start automatically at system startup. It is also possible now to start and stop dsmcad using standard linux facility service:
  • To start dsmcad manually run:
    # service dsmcad start
  • To stop dsmcad run:
    # service dsmcad stop
  • To restart dsmcad (for example to refresh daemon after dsm.sys or dsm.opt modification) :
    # service dsmcad restart
  • To check if dsmcad is running run:
    # service dsmcad status
    -or-
    # ps -ef | grep dsmcad

Rate this page:

(0 users)Average rating

Document information


More support for:

Tivoli Storage Manager
Client

Software version:

All Supported Versions

Operating system(s):

Linux Red Hat - xSeries

Reference #:

1358414

Modified date:

2010-12-06

Translate my page

Machine Translation

Content navigation