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. -- Registered Linux Addict #431495 http://profile.xfire.com/mrstalinman | John 3:16! http://www.fsdev.net/ | http://lordsauron.wordpress.com/
signature.asc
Description: OpenPGP digital signature
