updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / torque / torque-server
blobd62b74efa6d6115d1a2655e6ee5f3e9a209313fe
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 DAEMON=pbs_server
7 ARGS=
9 [ -r /etc/conf.d/$DAEMON ] && . /etc/conf.d/$DAEMON
11 PID=$(pidof -o %PPID $DAEMON)
13 case "$1" in
14 start)
15 stat_busy "Starting $DAEMON"
16 [ -z "$PID" ] && $DAEMON $ARGS &>/dev/null
17 if [ $? = 0 ]; then
18 add_daemon $DAEMON
19 stat_done
20 else
21 stat_fail
22 exit 1
25 stop)
26 stat_busy "Stopping $DAEMON"
27 [ -n "$PID" ] && kill $PID &>/dev/null
28 if [ $? = 0 ]; then
29 rm_daemon $DAEMON
30 stat_done
31 else
32 stat_fail
33 exit 1
36 restart)
37 $0 stop
38 sleep 1
39 $0 start
42 echo "usage: $0 {start|stop|restart}"
43 esac