iro/MyIro_daemon
author Sandro Knauß <knauss@netzguerilla.net>
Thu, 22 Oct 2009 10:00:01 +0200
changeset 0 a3b6e531f0d2
child 24 2119564de7a9
permissions -rwxr-xr-x
[svn r93] creating iro package branch

#! /bin/sh
NAME="IRO"
DEAMON=/home/sandy/svn/daemon/MyIro
DEAMON_OPTS=""
PID=/home/sandy/var/run/$NAME.pid

test -x $DEAMON || exit 0

. /lib/lsb/init-functions

case "$1" in
  start)
	log_daemon_msg "Starting $NAME" $NAME
	if start-stop-daemon --start --quiet --oknodo --pidfile $PID --make-pidfile --background --chuid sandy --group sandy --chdir /home/sandy/svn/iro --startas $DEAMON -- $DEAMON_OPTS; then
	    log_end_msg 0
	else
	    log_end_msg 1
	fi
	;;
  stop)
	log_daemon_msg "Stopping $NAME" $NAME
	if start-stop-daemon --stop --quiet --oknodo --pidfile $PID; then
	    log_end_msg 0
	else
	    log_end_msg 1
	fi
	;;

  restart)
	$0 stop
	sleep 1
	$0 start
	;;

  status)
	status_of_proc -p $PID $DEAMON $NAME && exit 0 || exit $?
	;;

  *)
	log_action_msg "Usage: $0 {start|stop|restart|status}"
	exit 1
esac

exit 0