#!/bin/sh # # dcd This shell script takes care of starting and stopping DConnect Daemon # # chkconfig: 2345 91 35 # description: D****ct Connect Hub running in daemon mode # processname: dcd # # pidfile: /var/run/dcd.pid # Source function library. . /etc/rc.d/init.d/functions # Get config. . /etc/sysconfig/network # Check that networking is up. if [ ${NETWORKING} = "no" ] then exit 0 fi [ -f /etc/sysconfig/dcd ] && . /etc/sysconfig/dcd # See how we were called. case "$1" in start) gprintf "Starting DConnect Daemon:" if [ -f /var/lock/subsys/dcd ]; then start_info="Error: Service is already running. First use '$0 stop'" else start_info=`nice -n$SERVICE_RUN_NICE_LEVEL ${exec_prefix}/sbin/dcd $OPTIONS 2>&1` fi if [ -n "$start_info" ]; then failure; gprintf "\n" echo "$start_info" else success; gprintf "\n" [ -n "$start_info" ] && echo "$start_info" touch /var/lock/subsys/dcd fi ;; stop) gprintf "Shutting down DConnect Daemon: " killproc dcd -TERM RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/dcd ;; status) status dcd RETVAL=$? ;; restart) $0 stop $0 start RETVAL=$? ;; reload) gprintf "Re-reading DConnect Daemon config: " killproc dcd -HUP RETVAL=$? echo ;; *) gprintf "Usage: %s {start|stop|status|restart|reload}\n" "$0" exit 1 esac if [ $# -gt 1 ]; then shift $0 $* fi exit $RETVAL