Sunday, January 10, 2010

Using pidof to test a daemon that is running

Pidof program can be used to test whether a particular daemon is working by providing a process identifier (PID) of a running daemon that you have supplied.

If pidof is used to determine a daemon (for example sendmail) is running, and if sendmail is running, pidof will exit with a return code of 0 and the PID is printed. If however, the daemon (for example sendmail) is not working, pidof will not print anything and exit with a nonzero return code

 Redhat Derivatives already come with pidof installed. If you do not have the program, you can install by using
# yum install sysvinit-tools 

No comments: