Search code examples
bashcroncentosnamed

Start named via Cron?


How can I can check status of the named via a Cron?

And how can I start it if it is down?


Solution

  • what do you mean check status via cron? what good would that do? how to start it up depends on your version of *nix. In Fedora/Redhat you could use chkconfig --list | grep named to check the status, then use service named start to start it up and chkconfig on named to have it start up at boot time. Check the man page for chkconfig for more info.


    Something like this should get it started back up for you. Just made sure it is in root crontab as it will need root perm to start named. Also, if you have more than one process by the name of named, you could run into problems with this. One last thing, you will want to fix the scheduling part (the * * * * *) to run as often as you need.

    * * * * * /bin/ps -C named > /dev/null 2>&1 || service named start