Created
December 16, 2011 14:07
-
-
Save schlady/1486162 to your computer and use it in GitHub Desktop.
Debian/Ubuntu init script for IBM Tivoli Storage Manager Client Schedule
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: dsmc | |
# Required-Start: $local_fs $network $syslog | |
# Required-Stop: $local_fs $network $syslog | |
# Default-Start: 3 5 | |
# Default-Stop: 0 1 2 6 | |
# Short-Description: Start and stop the Tivoli Storage Client | |
# Description: Control the IBM Tivoli Storage Manager Client Schedule instance | |
### END INIT INFO | |
DAEMON_SERVER=/opt/tivoli/tsm/client/ba/bin/dsmc | |
DAEMON_SERVER_OPTS="sched" | |
NAME_SERVER=dsmc | |
DESC="Tivoli Storage Client" | |
PIDFILE=/var/run/$NAME_SERVER.pid | |
test -x $DAEMON_SERVER || exit 0 | |
# Load lsb functions | |
. /lib/lsb/init-functions | |
case "$1" in | |
start) | |
log_daemon_msg "Starting $DESC" | |
log_progress_msg "$NAME_SERVER" | |
start-stop-daemon --start --quiet \ | |
--pidfile $PIDFILE --make-pidfile \ | |
--background --oknodo \ | |
--exec $DAEMON_SERVER -- $DAEMON_SERVER_OPTS | |
log_end_msg $? | |
;; | |
stop) | |
log_daemon_msg "Stopping $DESC" "$DAEMON_SERVER" | |
start-stop-daemon --stop --quiet --pidfile $PIDFILE \ | |
--oknodo --exec $DAEMON_SERVER | |
log_end_msg $? | |
;; | |
restart) | |
$0 stop && sleep 2 && $0 start | |
;; | |
*) | |
echo "Usage: $0 {start|stop|restart}" | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment