#!/bin/bash # # orbited This init script runs the orbited daemon # # Author: Luke Macken <lmacken@redhat.com # # description: Enabled the orbited daemon # processname: orbited # # source function library . /etc/rc.d/init.d/functions prog=orbited lockfile=/var/lock/subsys/$prog RETVAL=0 start() { echo -n $"Starting Orbited: " if [ -f $lockfile ]; then echo Orbited already running exit 2; fi touch $lockfile daemon --check $prog orbited --daemon RETVAL=$? echo } stop() { echo -n $"Stopping Orbited: " killproc $prog /bin/rm ${lockfile} 2> /dev/null && success || failure RETVAL=$? echo } restart() { stop start } case "$1" in start) start ;; stop) stop ;; restart|force-reload) restart ;; reload) ;; condrestart) [ -f "$lockfile" ] && restart ;; status) if [ -f $lockfile ]; then echo $"Orbited is running." RETVAL=0 else echo $"Orbited is not running." RETVAL=3 fi ;; *) echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}" exit 1 esac exit $RETVAL