Created
June 26, 2016 19:19
-
-
Save gottaloveit/57f0da427b469d7929bd90663c0535d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ubuntu upstart file at /etc/init/mongodb.conf | |
pre-start script | |
mkdir -p /MongoData/data | |
mkdir -p /MongoData/log | |
ln -s /MongoData/data/ /var/lib/mongodb/ | |
ln -s /MongoData/log/ /var/log/mongodb/ | |
end script | |
start on runlevel [2345] | |
stop on runlevel [06] | |
script | |
ENABLE_MONGODB="yes" | |
if [ -f /etc/default/mongodb ]; then . /etc/default/mongodb; fi | |
if [ "x$ENABLE_MONGODB" = "xyes" ]; then | |
if [ -f /var/lib/mongodb/mongod.lock ]; then | |
rm /var/lib/mongodb/mongod.lock | |
sudo -u mongodb /usr/bin/mongod --config /etc/mongodb.conf --repair | |
fi | |
exec start-stop-daemon --start --quiet --chuid mongodb --exec /usr/bin/mongod -- --config /etc/mongodb.conf | |
fi | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment