Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 8c1a7a03857a93af6a9c21272c3c00aa > files > 2

orbited-0.7.10-3.fc13.noarch.rpm

#!/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