4 # description: codemux startup script
9 . /etc/rc.d/init.d/functions
13 pidfile=/var/run/$PROC.pid
15 [ -r /etc/sysconfig/codemux ] && . /etc/sysconfig/codemux
18 pid=`cat $pidfile 2>/dev/null`
20 # this eliminates a race condition between checking existence of pidfile
21 # and reading its value
23 [ -n "$pid" -a -d /proc/$pid ]
28 echo -n "starting $PROC:"
29 pid=`cat $pidfile 2>/dev/null`
30 if [ -n "$pid" ]; then
31 # check whether process really exists
32 # yes - don't try to start
33 [ -d /proc/$pid ] && action "already running" /bin/true && exit 1
35 # no - PID file is stale
39 #initlog -c /usr/sbin/codemux # Depricated
40 /usr/sbin/codemux $CODEMUX_OPTS
43 check_status && touch /var/lock/subsys/$PROC || cmd=failure
49 echo -n "shutting down $PROC: "
54 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROC
64 check_status && echo 'running' && exit 0 || \
65 echo 'not running' && exit 1
69 if test -f /var/lock/subsys/$PROC; then
77 echo "Usage: $0 {start|stop|restart|status|condrestart}"