iro/MyIro_daemon
changeset 0 a3b6e531f0d2
child 24 2119564de7a9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/iro/MyIro_daemon	Thu Oct 22 10:00:01 2009 +0200
@@ -0,0 +1,44 @@
+#! /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