Skip to content

Instantly share code, notes, and snippets.

@allanbatista
Forked from benileo/mongod.service
Last active March 14, 2016 18:48
Show Gist options
  • Save allanbatista/4639840d2355ed63e711 to your computer and use it in GitHub Desktop.
Save allanbatista/4639840d2355ed63e711 to your computer and use it in GitHub Desktop.
Systemd Service Script for Mongod On Ubuntu 15.04+
##
# UpStart mongod
# /lib/systemd/system/mongod.service
# sudo systemctl enable mongod.service
# sudo systemctl start mongod.service
[Unit]
Description=High-performance, schema-free document-oriented database
Documentation=man:mongod(1)
After=network.target
[Service]
Type=forking
User=mongodb
Group=mongodb
RuntimeDirectory=mongod
PIDFile=/var/run/mongod/mongod.pid
ExecStart=/usr/bin/mongod -f /etc/mongod.conf --pidfilepath /var/run/mongod/mongod.pid --fork
TimeoutStopSec=5
KillMode=mixed
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment