« System management tools | Main | CVS for All »

PSMON

SourceForge.net: Project Info - PSMON - Process Monitoring Daemon psmon is a *NIX process monitoring daemon which may optionally be run as a standalone program. Allows slaying and respawning of critical processes which die, or exceed pre-determined TTL, concurrent instances and or memory or CPU usage.
I should probably explain myself a little better in the man pages for the combined use of --daemon and --cron. Will update it over the weekend I think. If you psmon as a daemon, (psmon --daemon), then it will report to the local console telling you that it's being launched in to the background. If you try and start it as a daemon, but it is already running as a daemon, then it will tell you not to be so silly, and will quit. Now,... what I usually do, is get psmon to start up as a background daemon from cron every 5 minutes or so. That way, is psmon has died for any reason, it will start up again. If it was still already running, then that's fine, because it will just quit and leave the existing instance running. The only problem with that, is that you will get an email from cron every 5 minutes, when psmon reports that it's quitting because it is already running (unless you redirect the output, which I think is nasty and evil). .... soooo ... you can use the --cron option, which will surpress the "psmon is already running as a background daemon" messages that are displayed when trying to launch psmon as a background daemon. If it finds that psmon is *NOT* already running, and it *DOES* in fact start up again as a background daemon, then those messages are still displayed, thus you get an email notification from cron telling you as such.