#!/bin/bash
DESC="TSM Client Accpetor Daemon"
NAME="dsmcad"
DAEMON=/opt/tivoli/tsm/client/ba/bin/$NAME
SCRIPTNAME="/etc/init.d/$NAME"
. /lib/lsb/init-functions
DSM_CONFIG=/opt/tivoli/tsm/client/ba/bin/dsm.opt
DSM_DIR=/opt/tivoli/tsm/client/ba/bin/
DSM_LOG=/opt/tivoli/tsm/client/ba/bin/
LANG=en_US.utf8
LC_ALL=en_US.utf8
export DSM_DIR DSM_CONFIG DSM_LOG LANG LC_ALL
rootcheck() {
if [ $UID -ne 0 ] ; then
echo "You must be a root user" 2>&1
exit 1
fi
}
pidof_dsmcad() {
PID=$(pidof $DAEMON)
if [ ! $PID ]; then
return 1
fi
echo $PID
}
d_start () {
rootcheck
if [ ! $(pidof_dsmcad) ]; then
$DAEMON > /dev/null 2>&1
fi
}
d_stop() {
rootcheck
pkill -f $DAEMON
}
d_status() {
if [ $(pidof_dsmcad) ]; then
echo "$DESC is running"
else
echo "$DESC is not running"
fi
}
case $1 in
start)
log_daemon_msg "Starting" $DESC $DAEMON
d_start
if [ $(pidof dsmcad) ]; then
log_end_msg 0
else
log_end_msg 1
fi
;;
stop)
log_daemon_msg "Stopping" $DESC $DAEMON
d_stop
sleep 2
if [ $(pidof $DAEMON) ]; then
log_end_msg 1
else
log_end_msg 0
fi
;;
status)
d_status
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: /etc/init.d/dsmcad {start|stop|restart|status}"
;;
esac
Tuesday, July 23, 2013
Configuring TSM Client Acceptor Daemon under Ubuntu 12.04
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment