Skip to content

Instantly share code, notes, and snippets.

@yalab
Created June 16, 2012 03:54
Show Gist options
  • Save yalab/2939835 to your computer and use it in GitHub Desktop.
Save yalab/2939835 to your computer and use it in GitHub Desktop.
Upstart script mongodb sharding config server
# Ubuntu upstart file at /etc/init/mongoc.conf
pre-start script
mkdir -p /var/lib/mongoc/
chown mongodb:mongodb /var/lib/mongoc/
end script
start on runlevel [2345]
stop on runlevel [06]
script
ENABLE_MONGODB="yes"
PIDFILE=/var/run/mongo_config.pid
if [ "x$ENABLE_MONGODB" = "xyes" ]; then exec start-stop-daemon --start --quiet --chuid mongodb -m --pidfile $PIDFILE --exec /usr/bin/mongod -- --configsvr --config /etc/mongoc.conf; fi
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment