I'm running a mongod process on my Centos 6.8 box, and I want to provide some level of resilience in the event of process death.
So I created an entry in my /etc/inittab
-
md:2345:respawn:/usr/bin/mongod
To test this, I killed the process, and expected it to restart. But it didn't.
$ service mongod status
mongod dead but subsys locked
This message indicates there's a pid file present /var/run/mongodb/mongod.pid
, so init thinks the process is still running.
Question: Is there an automatic way for init to remove the pid file and restart mongod?