|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| Tips and Tutorials Helpful articles from our Users. |
|
|
Search this Thread |
|
#1
|
||||
|
||||
|
My "Bread and Butter" Process Keep Alive Perl Script....
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. |
| Sponsored Links | ||
|
|
| Tags |
| keep alive |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| script running with "ksh" dumping core but not with "sh" | simhe02 | HP-UX | 9 | 11-04-2008 07:52 PM |
| How to include RETURN KEY with Background process "&" in Shell Script | racbern | Shell Programming and Scripting | 1 | 03-11-2008 06:30 AM |
| #!/bin/sh script fails at StringA | tr "[x]" "[y]" | by_tg | UNIX for Dummies Questions & Answers | 3 | 02-22-2008 11:17 AM |
| Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" | Lokesha | UNIX for Dummies Questions & Answers | 4 | 12-20-2007 12:52 AM |
| Pid still alive after "control C" | Nicol | Shell Programming and Scripting | 4 | 05-11-2005 11:15 AM |