updated on Sat Jan 21 20:03:50 UTC 2012
[aur-mirror.git] / meteor / meteord
blob220f5aa4e0f67b1efeab75d901da31b9a6019cd8
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID=`pidof -o %PPID /usr/sbin/meteord`
8 case "$1" in
9 start)
10 stat_busy "Starting meteord"
11 if [ ! -z "$PID" ]; then
12 stat_fail
13 else
14 echo 65535 > /proc/sys/fs/file-max
15 ulimit -n 65535
16 sudo -u meteor /usr/sbin/meteord >/var/log/meteord 2>&1
17 if [ $? -gt 0 ]; then
18 stat_fail
19 else
20 add_daemon meteor
21 stat_done
25 stop)
26 stat_busy "Stopping meteord"
27 if [ -z "$PID" ]; then
28 stat_fail
29 else
30 kill $PID &>/dev/null
31 if [ $? -gt 0 ]; then
32 stat_fail
33 else
34 rm_daemon meteor
35 stat_done
39 restart)
40 $0 stop
41 sleep 1
42 $0 start
45 echo "usage: $0 {start|stop|restart}"
47 esac