-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmongo-init
44 lines (34 loc) · 1003 Bytes
/
mongo-init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
### BEGIN INIT INFO
# Provides: mongodb
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts mongodb database system
# Description: starts mongodb using basic start scripts
### END INIT INFO
PATH=/opt/mongodb/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/local/bin:/opt/local/sbin
NAME=mongodb
test -x $DAEMON || exit 0
set -e
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --user mongodb -c mongodb:mongodb \
--startas /opt/local/bin/mongodb-start
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --exec /opt/local/mongo/current/bin/mongod -c mongodb:mongodb \
/opt/local/bin/mongodb-stop
echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop}" >&2
exit 1
;;
esac
exit 0