#! /bin/sh # # kojisd Start/Stop kojisd # # chkconfig: 345 99 99 # description: koji subscriber daemon # processname: kojisd # This is an interactive program, we need the current locale # Source function library. . /etc/init.d/functions # Check that we're a priviledged user [ `id -u` = 0 ] || exit 0 [ -f /etc/sysconfig/kojisd ] && . /etc/sysconfig/kojisd prog="kojisd" # Check that networking is up. if [ "$NETWORKING" = "no" ] then exit 0 fi [ -f /usr/sbin/kojisd ] || exit 0 RETVAL=0 start() { echo -n $"Starting $prog: " cd / ARGS="" [ "$FORCE_LOCK" == "Y" ] && ARGS="$ARGS --force-lock" [ "$KOJIRA_DEBUG" == "Y" ] && ARGS="$ARGS --debug" [ "$KOJIRA_VERBOSE" == "Y" ] && ARGS="$ARGS --verbose" if [ -n "$RUNAS" -a "$RUNAS" != "root" ]; then daemon --user "$RUNAS" /usr/sbin/kojisd $ARGS else daemon /usr/sbin/kojisd $ARGS fi RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/kojisd return $RETVAL } stop() { echo -n $"Stopping $prog: " killproc kojisd RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/kojisd return $RETVAL } restart() { stop start } # See how we were called. case "$1" in start) start ;; stop) stop ;; status) status $prog ;; restart|reload) restart ;; condrestart) [ -f /var/lock/subsys/kojisd ] && restart || : ;; *) echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}" exit 1 esac exit $?