On Sat, Sep 6, 2008 at 2:34 AM, Chris Miller <[EMAIL PROTECTED]> wrote: > I was wondering if anyone knew of a tool that could provide a bit more > immediate results, constantly verifying that a process or daemon is > running, and to start it if it's not. I'd settle for something that > runs every minute (that isn't a cron job, since they leave me feeling > very icky, kind of like a lame hack. It works, but there should be a > better solution).
Most system processes (e.g. those in /etc/init.d/) create a .pid file in /var/run: $ ls -la /var/run/*.pid You can use that as a way to check if a system is up and running. Using apache as an example: ps -p $(cat /var/run/apache2.pid 2> /dev/null ) >& /dev/null || echo "restart apache" Why the beef with crontab? > I was thinking that there's bound to be a kind of "process nazi" tool > that'll keep things running smoothly, but I don't know of any. I'm > running Debian 5. I'm guessing there's a reason you are running Debian 5 despite it being labeled as "testing": http://www.debian.org/releases/testing/ Regards, - Robert --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Linux Users Group. To post a message, send email to [email protected] To unsubscribe, send email to [EMAIL PROTECTED] For more options, visit our group at http://groups.google.com/group/linuxusersgroup -~----------~----~----~----~------~----~------~--~---
