2017-05-27 18:09:50 +00:00
|
|
|
[Unit]
|
|
|
|
Description=High-performance, schema-free document-oriented database
|
|
|
|
After=syslog.target network.target
|
2018-07-23 13:44:17 +00:00
|
|
|
|
2017-05-27 18:09:50 +00:00
|
|
|
[Service]
|
2018-05-26 23:16:10 +00:00
|
|
|
Type=simple
|
2017-05-27 18:09:50 +00:00
|
|
|
User=mongodb
|
|
|
|
Group=mongodb
|
2018-07-23 13:44:17 +00:00
|
|
|
# FAILS (after power failures, etc) as --repair cannot run when lock file exists: (https://github.com/iiab/iiab/issues/942)
|
|
|
|
#ExecStartPre=/usr/bin/mongod --repair --dbpath /library/dbdata/mongodb
|
|
|
|
# FAILS as systemd cannot run bash here:
|
|
|
|
#ExecStartPre=if [ ! -f /library/dbdata/mongodb/mongod.lock ]; then /usr/bin/mongod --repair --dbpath {{ mongodb_db_path }}; fi
|
|
|
|
ExecStartPre=/usr/bin/iiab-mongodb-repair-if-no-lock
|
2018-07-17 17:15:04 +00:00
|
|
|
ExecStart=/usr/bin/mongod -f {{ mongodb_conf }}
|
2018-07-17 16:51:55 +00:00
|
|
|
ExecStop=/usr/bin/killall mongod
|
2018-07-23 13:44:17 +00:00
|
|
|
# killall's SIGTERM (15) seems fine, to induce a graceful stop. This would work too:
|
|
|
|
#ExecStop=mongod --dbpath {{ mongodb_db_path }} --shutdown
|
|
|
|
|
2017-05-27 18:09:50 +00:00
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|