Skip to content

Instantly share code, notes, and snippets.

@Om4ar
Forked from jwilm/mongodb.service
Created April 25, 2018 01:51
Show Gist options
  • Save Om4ar/d5f8b1ca70adf560762c3af3fb25e04c to your computer and use it in GitHub Desktop.
Save Om4ar/d5f8b1ca70adf560762c3af3fb25e04c to your computer and use it in GitHub Desktop.
MongoDB systemd service unit configuration
[Unit]
Description=MongoDB Database Service
Wants=network.target
After=network.target
[Service]
Type=forking
PIDFile=/var/run/mongodb/mongod.pid
ExecStart=/usr/local/bin/mongod --config /etc/mongod.conf
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
User=mongodb
Group=mongodb
StandardOutput=syslog
StandardError=syslog
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment