For the newbies, I should have posted this years ago....
Here is the standard (tiny) "bread and butter" perl script (on Linux) I use in my crontab files to insure key processes are alive ( just in case ! ) like httpd, named, sshd, etc.
The example below if for named......
Code:
#!/usr/bin/perl
open(PS,"/bin/ps x|") || die "Can't Open PS";
while(<PS>) {
if (/usr\/sbin\/named/) { close PS; exit;}
}
close PS;
system("/usr/sbin/named");
One of my biggest "server fears" is that sshd will die for some strange reason, so I feel safe knowing that sshd is always running with the script above.
New Linux/UNIX users might find it useful.