summaryrefslogtreecommitdiff
path: root/debian/init.d
diff options
context:
space:
mode:
Diffstat (limited to 'debian/init.d')
-rw-r--r--debian/init.d15
1 files changed, 11 insertions, 4 deletions
diff --git a/debian/init.d b/debian/init.d
index 8af7a73ceb0..20dd23ca20b 100644
--- a/debian/init.d
+++ b/debian/init.d
@@ -44,16 +44,23 @@
#
# High performance, scalability, and reasonable depth of
# functionality are the goals for the project.
-#
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=/bin/mongod
-DAEMON_OPTS='--dbpath /var/lib/mongodb run'
+DAEMON=/usr/bin/mongod
+DATA=/var/lib/mongodb
+DAEMON_OPTS="--dbpath $DATA run"
NAME=MongoDB
DESC=database
-test -x $DAEMON || exit 0
+if test ! -x $DAEMON; then
+ echo "Could not find $DAEMON"
+ exit 0
+fi
+
+if test ! -x $DATA; then
+ mkdir $DATA || exit 0
+fi
. /lib/lsb/init-functions