Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Unix&Linux>>Check that a process hasn't crashed/quit

Check that a process hasn't crashed/quit

ibroughton
04-24-2005, 08:34 AM
How do I set a cron job to A)check that a process is still running and B)if it isn't running to start/restart as it's a daemon?

Juz10mac
04-24-2005, 08:44 AM
I found information on cron here http://www.vmts.net/crontab.htm. I know a little about cron, but not enough to have it check a process. Maybe you could make a script that will do that, then have cron run the script. I hope this helps

Juz10mac

voldenuit
04-24-2005, 09:02 AM
There are tools like

http://cr.yp.to/daemontools.html

They work great for me on a Debian server I run in a colo (qmail, tinydns), but I never tried it on Mac OS X.

Depending on the daemon in question, it might not be good enough to just make sure it runs, it should still provide the service it's supposed to.

qmail is pretty much bulletproof, if it runs, it works.
Apache for example has modes of failure where it will still run, but stops to deliver pages.

A Nagios-like solution that checks for the service and takes action as you script it if the test fails, is probably the best if you really care for continued service.

hayne
04-24-2005, 12:23 PM
If you just want to do it the simple, brute force way, look at this old thread:
http://forums.macosxhints.com/showthread.php?t=24044

ibroughton
04-24-2005, 01:02 PM
Excellent, got it all sorted out now!Many thanks!

CPYCGerry
04-26-2005, 10:54 AM
I just ran into a gotcha. On older Macs running tcsh (e.g. 10.2.x) make sure you write:
ps axwww filename

It turns out that the terminal may not be wide enough.


 

TOP

Windows Server Outsell
Unix Signals And C++ E

For more info

Unix Signals And C++ E
Windows Server Outsell
ssh setup for password
Bash script does not w
esc code 
ARD send unix command 
question about binarie
Scanning mail 
Issuing multiple comma
How do I install Linux

News Archive

/etc/hosts? 
Manually Start a Start
mounting missed hard d
Using Netinfo in Singl
darwin/bsd login probl
system_profiler and fi
Send mail from script 
mounting a drive 
OS X disk first aid ha
system.log shows steal

Related stories:

Application packages
Stupid Unix questions. Remove contents of directory.
Puzzlement: -bash: /sw/bin/init.sh: No such file or directory
JAVA help, please!
fat32+disk image
Change scroll speed of 'cat' command?
CUPS n00bie question

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics