-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Chris,
Everyone gave great answers, but why reinvent the wheel when there are awesome packages that will do exactly what you want with a web-interface as well. Enter monit(apt-get install monit)...it does exactly what is sounds like it does; monitor daemons. Monit will actually attempt to connect to your daemons at a set interval(1 minute on my system) and lie dormant if there is no alarm. When monit fails to connect it sends an email that the process is down and restarts it for you...it also send an email letting you know that the process is back up. It does ssl as well...this is what you need, it is a script indeed but has a bit more intelligence than the run of the mill cronjob. I use it for snmp, ldap, nscd, apache, postfix, blah and blah blah. This thing is totally customizable and there are tons of examples out in the wild. There is one file to config and it is super easy at that. A LOT of people use monit to keep mongrels stuff rolling. We are not really addressing the problem though Chris...how can you just run out of memory? No swap partition? Swap not big enough? Did you make a swap file even? How do you know these things are crashing because they are out or memory? What error does apache throw to you? Bryan Chris Miller wrote: | Robert Citek wrote: |> 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? | | It leaves me with the icky feeling of a bad hack. I keep feeling that | there should be a more elegant, problem-specific, fine-tuned solution. | Something written in a real programming language like C with cryptic | configuration file documentation and near ubiquitous, yet hilariously | unspoken use all over the place. | | Yes, I am aware that I just described 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": | | Heh. You've probably never tried to set up Ruby on Rails on Debian. | Let's just say that the maintainers weren't aware that there was a | hideous flaw in the supplied software, and I'm too lazy to downgrade to | a supposedly more stable version after having done the work to upgrade. | | The tale of joys and woes to get my site working is here: | | http://lordsauron.wordpress.com/2008/06/18/zero-to-redmine-in-22-steps/ | | Please notice that I disclose all my configuration secrets not because | I'm confident my server is super-secure (I'm not) but because it was a | PITA to get running, and I don't want anyone to ever have to beat | through all that nonsense without documentation again. | - -- A healthy diet includes Linux, Linux and more Linux. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIwuNlh+MLjl5SKYQRAvIEAKCB405O34JGSMRjIbOnrl7zNF6bawCeJQBU WeRwp531x6QYCcDEm56bpBA= =XuA+ -----END PGP SIGNATURE----- --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
