]> git.pld-linux.org Git - packages/ggz-server.git/blob - ggz-server.init
- rel 6
[packages/ggz-server.git] / ggz-server.init
1 #!/bin/sh
2 #
3 # chkconfig:    345 90 10
4 # description:  GGZ project games server
5 #
6 # ggzd          GGZ project games server deamon
7
8 # Source function library
9 . /etc/rc.d/init.d/functions
10
11 # Get service config
12 [ -f /etc/sysconfig/ggzd ] && . /etc/sysconfig/ggzd
13
14 start() {
15         if [ ! -f /var/lock/subsys/ggzd ]; then
16                 msg_starting ggzd
17                 daemon --user games /usr/bin/ggzd
18                 RETVAL=$?
19                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ggzd
20         else
21                 msg_already_running ggzd
22         fi
23 }
24
25 stop() {
26         if [ -f /var/lock/subsys/ggzd ]; then
27                 msg_stopping ggzd
28                 killproc ggzd
29                 rm /var/lock/subsys/ggzd
30         else
31                 msg_not_running ggzd
32         fi
33 }
34
35 RETVAL=0
36 case "$1" in
37   start)
38         start
39         ;;
40   stop)
41         stop
42         ;;
43   status)
44         status ggzd
45         exit $?
46         ;;
47   restart|force-reload)
48         stop
49         start
50         ;;
51   *)
52         msg_usage "$0 {start|stop|restart|force-reload|status}"
53         exit 3
54 esac
55
56 exit $RETVAL
This page took 0.062099 seconds and 3 git commands to generate.