updated on Wed Jan 18 08:00:29 UTC 2012
[aur-mirror.git] / torque / torque-node
blobdfa46db9de9355f03accb6238dc2a7fba1b6fffd
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 DAEMON=pbs_mom
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 stat_busy "Giving $DAEMON 15s to stop" && stat_done
39 sleep 15
40 $0 start
43 echo "usage: $0 {start|stop|restart}"
44 esac