Bryan Smith wrote: > 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.
Sounds great. I'll look into it. > 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? It's literally the system running out of memory. It's a $15/month VPS, so memory is little. I get 317 MB for RAM and no swap space (I tried to create a file, mkswap and swapon - no luck... makes sense, how would they make their money otherwise?) I'm pretty certain they're out of memory because I'm always running within 30 MB of the total main memory limit. All that has to happen is for one process to spike, to not garbage collect soon enough, etc. and then the system will run genuinely and completely out of memory. The kernel will try and find a scapegoat to butcher at the High Tribunal of Memory Abusers, and it usually ends up being one of my more important processes. I haven't really got a problem if the server fails to deliver a page every once in a while, but it needs to pick itself back up (immediately if at all possible) to make the user happy when he/she hits "refresh." > 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. > | > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~--- -- 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
