]> git.pld-linux.org Git - packages/wesnoth.git/blobdiff - wesnothd.init
- release 15, rebuild against boost 1.70.0
[packages/wesnoth.git] / wesnothd.init
index 1bd916c1de66a371236c933cfb54be09cd2fb85d..c73159718a8217b9dc530c22dd0d4a503dd7edaf 100644 (file)
@@ -7,23 +7,22 @@
 
 # Source function library
 . /etc/rc.d/init.d/functions
+
 # Get service config
 [ -f /etc/sysconfig/wesnothd ] && . /etc/sysconfig/wesnothd
 
-RETVAL=0
-case "$1" in
-  start)
+start() {
        if [ ! -f /var/lock/subsys/wesnothd ]; then
                msg_starting wesnothd
-               daemon "su - nobody -s /bin/sh -c '/usr/bin/wesnothd &'"
+               daemon --user wesnothd --fork '/usr/bin/wesnothd -p 14999 > /dev/null 2>&1'
                RETVAL=$?
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/wesnothd
        else
                msg_already_running wesnothd
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/wesnothd ]; then
                msg_stopping wesnothd
                killproc wesnothd
@@ -31,19 +30,27 @@ case "$1" in
        else
                msg_not_running wesnothd
        fi
+}
+
+RETVAL=0
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   status)
        status wesnothd
        exit $?
        ;;
   restart|force-reload)
-       $0 stop
-       $0 start
-       exit $?
+       stop
+       start
        ;;
   *)
        msg_usage "$0 {start|stop|restart|force-reload|status}"
        exit 3
 esac
+
 exit $RETVAL
This page took 0.068291 seconds and 4 git commands to generate.