Skip to content

Instantly share code, notes, and snippets.

@wilburding
Last active August 29, 2015 14:24
Show Gist options
  • Save wilburding/65456b81b27cf49a655a to your computer and use it in GitHub Desktop.
Save wilburding/65456b81b27cf49a655a to your computer and use it in GitHub Desktop.
mongod.service
[Unit]
Description=mongod.service
After=network.target disable_thp.service
[Service]
ExecStartPre=/usr/bin/install -d -m 0755 -o mongod -g mongod /var/run/mongodb
ExecStart=/usr/bin/mongod -f /etc/mongod.conf --fork --pidfilepath=/var/run/mongodb/mongod.pid
ExecStop=/usr/bin/kill -TERM $MAINPID
Type=forking
PIDFile=/var/run/mongodb/mongod.pid
User=mongod
Group=mongod
PermissionsStartOnly=true
Restart=always
LimitFSIZE=infinity
LimitCPU=infinity
LimitNOFILE=64000
LimitNPROC=64000
LimitDATA=infinity
LimitRSS=infinity
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment