mongodb.service for systemd

Tested only on Fe­dora 19

File /etc/systemd/system/mongodb.service con­tents:

[Unit]
Description=Mongo is a scalable, document-oriented database.
After=syslog.target network.target

[Service]
Type=forking
ExecStart=/usr/bin/mongod $OPTIONS run
User=mongod
Group=mongod
EnvironmentFile=/etc/sysconfig/mongod
# comment out if dbpath and/or pidfilepath (/etc/mongod.conf)
# are set in /var/*/* (by default)
#NoNewPrivileges=yes
#PIDFile=/var/run/mongod.pid

[Install]
WantedBy=multi-user.target

File /etc/sysconfig/mongod con­tents:

# TODO: add relevant configuration stuff here.
OPTIONS="--quiet -f /etc/mongod.conf"

En­able auto­start

# systemctl enable mongodb



source - https://blog.while.cc/2013/09/30/mongodb-dot-service-for-systemd/


'DB > MongoDB' 카테고리의 다른 글

mongo - drop all indexes  (0) 2015.04.07
mongodb - modify /etc/rc.d/init.d/mongod in fedora  (0) 2014.07.20
mongodb - mongodb.service for systemd  (0) 2014.07.20
mongodb - save, insert  (0) 2014.05.08
mongo - v2.6 error  (0) 2014.04.25
mongodb gridfs - find files_id  (0) 2014.04.22
Posted by linuxism

댓글을 달아 주세요