updated on Sat Jan 14 12:12:45 UTC 2012
[aur-mirror.git] / mongodb-git / mongodb.rc
bloba3c840768379b31c665b27494bb72c0b8ef6648a
1 #!/bin/bash
2 # vim: syntax=sh
4 . /etc/rc.conf
5 . /etc/rc.d/functions
6 . /etc/conf.d/mongodb
8 PID=`pidof /usr/bin/mongod`
9 case "$1" in
10 start)
11 stat_busy "Starting mongod"
12 [ -z "$PID" ] && /bin/su mongodb -c "/usr/bin/mongod ${MONGOD_ARGS} run &" > /var/log/mongod 2>&1
13 if [ $? -gt 0 ]; then
14 stat_fail
15 else
16 add_daemon mongod
17 stat_done
20 stop)
21 stat_busy "Stopping mongod"
22 [ ! -z "$PID" ] && kill $PID &> /dev/null
23 if [ $? -gt 0 ]; then
24 stat_fail
25 else
26 rm_daemon mongod
27 stat_done
30 restart)
31 $0 stop
32 $0 start
35 echo "usage: $0 {start|stop|restart}"
36 esac
37 exit 0