blob: 9ddd605646889a3519205abe71293ce421a60312 (
plain)
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
45
|
#!/sbin/runscript
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-db/mongodb/files/mongodb.initd,v 1.1 2010/03/07 23:39:39 ramereth Exp $
depend() {
need net
}
start() {
ebegin "Starting ${SVCNAME}"
if [ -z "$MONGODB_PID_FILE" ] ; then
ewarn "MONGODB_PID_FILE must be set"
return -1
fi
if [ -z "$MONGODB_USER" ] ; then
ewarn "ERROR: MONGODB_USER must be set"
return -1
fi
args=""
if [ -n "$MONGODB_DATA" ] ; then
args="$args --dbpath $MONGODB_DATA"
fi
if [ -n "$MONGODB_PORT" ] ; then
args="$args --port $MONGODB_PORT"
fi
if [ -n "$MONGODB_IP" ] ; then
args="$args --bind_ip $MONGODB_IP"
fi
if [ -n "$MONGODB_OPTIONS" ] ; then
args="$args $MONGODB_OPTIONS"
fi
start-stop-daemon --background --start --user ${MONGODB_USER} --pidfile \
"${MONGODB_PID_FILE}" --make-pidfile --exec ${MONGODB_EXEC} \
-- ${args} run
eend $?
}
stop() {
ebegin "Stopping ${SVCNAME}"
start-stop-daemon --stop --exec ${EXEC} --pidfile ${MONGODB_PID_FILE}
eend $? "Failed to stop ${SVCNAME}"
}
|