Re: daemon monitoring
+-Le 24/11/2003 14:50 -0800, Will Prater écrivait : | List, | | On Nov 24, 2003, at 3:14 AM, Mathieu Arnold wrote: | | +-le 23/11/2003 16:46 -0800, Will Prater écrivait : | | Sorry, I mispoke. I will be using Nagios to monitor, but I need to | make | | sure they will restart if there is an error. Will nagios do this as | well? | | Nagios can make use of net/nrpe, which can restart services. | | This is interesting. This would be all one needs to keep this up and | online. I dont see a real need for daemontools/supervise if one can use | nagios to monitor, report, and keep services online. | | Is anyone using Nagios in this manor? I do, it works pretty well. But with nrpe, it's not nagios that restart services, it's nrpe itself, nagios is just used to monitor the presence of the services. -- Mathieu Arnold ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: daemon monitoring
On Nov 24, 2003, at 2:59 PM, Jesse Guardiani wrote: I'm particularly fond of daemontools/supervise, actually. You've got to jump through some hoops to get it working (process must run in foreground, process must start first time, etc..), but it's very reliable and the qmail style qmailctl script can be adapted to any configuration with minimal work to make an excellent control script. Yes, it looks promising. I have it working for a few of my processes. I was looking to something similar to Mac OS X Servers watchdog. This is much better. I get weird errors when I am trying to get saslauthd since I have to use fghack to get it going. Can you send me the qmailctl script or some examples that you have with some daemons on your system? Do you have weirdness when working with daemons that run themselves in the backgroud? One has to use fghack to place them in the foreground and then there is no control to stop the service through daemontools. For example saslatuhd.. Also does one only need to create a log directory if the application itself does not log? Or is this to log other information, I cant seem to find an answer to this on DJB site. Thanks --will ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: daemon monitoring
On Tue, 25 Nov 2003 11:51:20 -0800 Will Prater [EMAIL PROTECTED] wrote: Also does one only need to create a log directory if the application itself does not log? Or is this to log other information, I cant seem to find an answer to this on DJB site. Thanks --will I'm pretty sure that if the application manages log files for itself, you don't need a log subdir. That's only useful for when you want to log (or otherwise intercept) the application's stdout/stderr/etc output. -Chris ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: daemon monitoring
On Nov 25, 2003, at 12:26 PM, Chris Pressey wrote: On Tue, 25 Nov 2003 11:51:20 -0800 Will Prater [EMAIL PROTECTED] wrote: Also does one only need to create a log directory if the application itself does not log? Or is this to log other information, I cant seem to find an answer to this on DJB site. Thanks --will I'm pretty sure that if the application manages log files for itself, you don't need a log subdir. That's only useful for when you want to log (or otherwise intercept) the application's stdout/stderr/etc output. This makes sense. Thanks ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: daemon monitoring
On Mon, Nov 24, 2003 at 01:19:21AM +, Jez Hancock wrote: - for each pid, send a CHLD signal to the pid Careful -- not all processes will be set up to deal with SIGCHLD, and some of them will be set up to deal with it in ways that don't meet your expectations. You can use signal '0' to test if a process of a given PID exists, without obnoxious side effects: % kill -0 $$ % echo $? 0 % kill -0 999 999: No such process % echo $? 1 However you need to be careful as kill is a shell built-in in many shells -- tcsh(1) has a built-in but it behaves just like /bin/kill in this case. sh(1) and bash(1) seem not to use a built-in. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK pgp0.pgp Description: PGP signature
Re: daemon monitoring
+-le 23/11/2003 16:46 -0800, Will Prater écrivait : | Sorry, I mispoke. I will be using Nagios to monitor, but I need to make | sure they will restart if there is an error. Will nagios do this as well? Nagios can make use of net/nrpe, which can restart services. -- Mathieu Arnold ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: daemon monitoring
On Mon, Nov 24, 2003 at 09:02:29AM +0300, Sergey 'DoubleF' Zaharchenko wrote: On Mon, 24 Nov 2003 02:11:39 +0100 Alex de Kruijff [EMAIL PROTECTED] probably wrote: Dear Will, I've moved you text to the buttom so its more readable for other. On Sun, Nov 23, 2003 at 04:46:09PM -0800, Will Prater wrote: On Nov 23, 2003, at 1:57 PM, Alex de Kruijff wrote: On Sun, Nov 23, 2003 at 10:52:48AM -0800, Will Prater wrote: List, What are most of you using to monitor the running daemons? I have been loooking into DJB daemontools which seems appropriate, but are there any others that you reccomend? If DJB's daemontools is the one, could I get some more examples? I am primarily trying to keep my mail system online: postfix, cyrus, saslauthd, mysql, and spamassassin. I would advise Nagios. Sorry, I mispoke. I will be using Nagios to monitor, but I need to make sure they will restart if there is an error. Will nagios do this as well? I don't *think* so. You could write a sh script (or any other) that does this. It could contain this line: result=px aux | grep SomeDaemon | wc -l If the result is zero than SomeDaemon is not running. You'd be better off using ps auxc here (that is, print only argv[0]): $ ps aux|grep aux df 642 0,0 0,4 648 444 p1 R+8:49 0:00,00 grep aux (sh) df 641 0,0 0,3 516 392 p1 R+8:49 0:00,00 ps aux which is obviously wrong for your situation, since the aux `daemon' is not running $ ps auxc|grep auxc nothing, which is right $ Your ride i forgot that one. I'll give an adjustment: result=px aux | grep SomeDaemon | grep -v aux | wc -l -- Alex Articles based on solutions that I use: http://www.kruijff.org/alex/index.php?dir=docs/FreeBSD/ ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: daemon monitoring
Will Prater wrote: List, What are most of you using to monitor the running daemons? I have been loooking into DJB daemontools which seems appropriate, but are there any others that you reccomend? If DJB's daemontools is the one, could I get some more examples? I am primarily trying to keep my mail system online: postfix, cyrus, saslauthd, mysql, and spamassassin. I'm particularly fond of daemontools/supervise, actually. You've got to jump through some hoops to get it working (process must run in foreground, process must start first time, etc..), but it's very reliable and the qmail style qmailctl script can be adapted to any configuration with minimal work to make an excellent control script. -- Jesse Guardiani, Systems Administrator WingNET Internet Services, P.O. Box 2605 // Cleveland, TN 37320-2605 423-559-LINK (v) 423-559-5145 (f) http://www.wingnet.net ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: daemon monitoring
On Nov 24, 2003, at 1:10 PM, Jesse Guardiani wrote: Will Prater wrote: List, What are most of you using to monitor the running daemons? I have been loooking into DJB daemontools which seems appropriate, but are there any others that you reccomend? If DJB's daemontools is the one, could I get some more examples? I am primarily trying to keep my mail system online: postfix, cyrus, saslauthd, mysql, and spamassassin. I'm particularly fond of daemontools/supervise, actually. You've got to jump through some hoops to get it working (process must run in foreground, process must start first time, etc..), but it's very reliable and the qmail style qmailctl script can be adapted to any configuration with minimal work to make an excellent control script. Yes, it looks promising. I have it working for a few of my processes. I was looking to something similar to Mac OS X Servers watchdog. This is much better. I get weird errors when I am trying to get saslauthd since I have to use fghack to get it going. Can you send me the qmailctl script or some examples that you have with some daemons on your system? Thanks -- Jesse Guardiani, Systems Administrator WingNET Internet Services, P.O. Box 2605 // Cleveland, TN 37320-2605 423-559-LINK (v) 423-559-5145 (f) http://www.wingnet.net ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] --will ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: daemon monitoring
List, On Nov 24, 2003, at 3:14 AM, Mathieu Arnold wrote: +-le 23/11/2003 16:46 -0800, Will Prater écrivait : | Sorry, I mispoke. I will be using Nagios to monitor, but I need to make | sure they will restart if there is an error. Will nagios do this as well? Nagios can make use of net/nrpe, which can restart services. This is interesting. This would be all one needs to keep this up and online. I dont see a real need for daemontools/supervise if one can use nagios to monitor, report, and keep services online. Is anyone using Nagios in this manor? Thanks --will ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: daemon monitoring
Will Prater wrote: On Nov 24, 2003, at 1:10 PM, Jesse Guardiani wrote: Will Prater wrote: List, What are most of you using to monitor the running daemons? I have been loooking into DJB daemontools which seems appropriate, but are there any others that you reccomend? If DJB's daemontools is the one, could I get some more examples? I am primarily trying to keep my mail system online: postfix, cyrus, saslauthd, mysql, and spamassassin. I'm particularly fond of daemontools/supervise, actually. You've got to jump through some hoops to get it working (process must run in foreground, process must start first time, etc..), but it's very reliable and the qmail style qmailctl script can be adapted to any configuration with minimal work to make an excellent control script. Yes, it looks promising. I have it working for a few of my processes. I was looking to something similar to Mac OS X Servers watchdog. This is much better. I get weird errors when I am trying to get saslauthd since I have to use fghack to get it going. Can you send me the qmailctl script or some examples that you have with some daemons on your system? From Life with Qmail: http://www.lifewithqmail.org/qmailctl-script-dt70 And check out this: http://www.lifewithqmail.org/lwq.html#start-qmail Particularly section 2.8.2.2, The supervise scripts. -- Jesse Guardiani, Systems Administrator WingNET Internet Services, P.O. Box 2605 // Cleveland, TN 37320-2605 423-559-LINK (v) 423-559-5145 (f) http://www.wingnet.net ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
daemon monitoring
List, What are most of you using to monitor the running daemons? I have been loooking into DJB daemontools which seems appropriate, but are there any others that you reccomend? If DJB's daemontools is the one, could I get some more examples? I am primarily trying to keep my mail system online: postfix, cyrus, saslauthd, mysql, and spamassassin. Thanks for any input --will ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: daemon monitoring
On Sun, Nov 23, 2003 at 10:52:48AM -0800, Will Prater wrote: List, What are most of you using to monitor the running daemons? I have been loooking into DJB daemontools which seems appropriate, but are there any others that you reccomend? If DJB's daemontools is the one, could I get some more examples? I am primarily trying to keep my mail system online: postfix, cyrus, saslauthd, mysql, and spamassassin. I would advise Nagios. -- Alex Articles based on solutions that I use: http://www.kruijff.org/alex/index.php?dir=docs/FreeBSD/ ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: daemon monitoring
Sorry, I mispoke. I will be using Nagios to monitor, but I need to make sure they will restart if there is an error. Will nagios do this as well? Thanks On Nov 23, 2003, at 1:57 PM, Alex de Kruijff wrote: On Sun, Nov 23, 2003 at 10:52:48AM -0800, Will Prater wrote: List, What are most of you using to monitor the running daemons? I have been loooking into DJB daemontools which seems appropriate, but are there any others that you reccomend? If DJB's daemontools is the one, could I get some more examples? I am primarily trying to keep my mail system online: postfix, cyrus, saslauthd, mysql, and spamassassin. I would advise Nagios. -- Alex Articles based on solutions that I use: http://www.kruijff.org/alex/index.php?dir=docs/FreeBSD/ ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] --will ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: daemon monitoring
Dear Will, I've moved you text to the buttom so its more readable for other. On Sun, Nov 23, 2003 at 04:46:09PM -0800, Will Prater wrote: On Nov 23, 2003, at 1:57 PM, Alex de Kruijff wrote: On Sun, Nov 23, 2003 at 10:52:48AM -0800, Will Prater wrote: List, What are most of you using to monitor the running daemons? I have been loooking into DJB daemontools which seems appropriate, but are there any others that you reccomend? If DJB's daemontools is the one, could I get some more examples? I am primarily trying to keep my mail system online: postfix, cyrus, saslauthd, mysql, and spamassassin. I would advise Nagios. Sorry, I mispoke. I will be using Nagios to monitor, but I need to make sure they will restart if there is an error. Will nagios do this as well? I don't *think* so. You could write a sh script (or any other) that does this. It could contain this line: result=px aux | grep SomeDaemon | wc -l If the result is zero than SomeDaemon is not running. -- Alex Articles based on solutions that I use: http://www.kruijff.org/alex/index.php?dir=docs/FreeBSD/ ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: daemon monitoring
On Mon, Nov 24, 2003 at 02:11:39AM +0100, Alex de Kruijff wrote: On Sun, Nov 23, 2003 at 04:46:09PM -0800, Will Prater wrote: On Nov 23, 2003, at 1:57 PM, Alex de Kruijff wrote: On Sun, Nov 23, 2003 at 10:52:48AM -0800, Will Prater wrote: List, What are most of you using to monitor the running daemons? I have been loooking into DJB daemontools which seems appropriate, but are there any others that you reccomend? If DJB's daemontools is the one, could I get some more examples? I am primarily trying to keep my mail system online: postfix, cyrus, saslauthd, mysql, and spamassassin. I would advise Nagios. Sorry, I mispoke. I will be using Nagios to monitor, but I need to make sure they will restart if there is an error. Will nagios do this as well? I don't *think* so. You could write a sh script (or any other) that does this. It could contain this line: result=px aux | grep SomeDaemon | wc -l If the result is zero than SomeDaemon is not running. Alternatively you could just write a script that polls a number of pid-files, one per daemon you want to monitor, and checks if the daemon is still running - if not it restarts the daemon. The gist of the script would be: - for each pid, send a CHLD signal to the pid - if the return code is 0, the process is still running so do nothing, otherwise restart the daemon I've not used daemontools too much away from djbdns suite, but presumably you could use supervise to do the work. -- Jez Hancock - System Administrator / PHP Developer http://munk.nu/ ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: daemon monitoring
On Mon, 24 Nov 2003 02:11:39 +0100 Alex de Kruijff [EMAIL PROTECTED] probably wrote: Dear Will, I've moved you text to the buttom so its more readable for other. On Sun, Nov 23, 2003 at 04:46:09PM -0800, Will Prater wrote: On Nov 23, 2003, at 1:57 PM, Alex de Kruijff wrote: On Sun, Nov 23, 2003 at 10:52:48AM -0800, Will Prater wrote: List, What are most of you using to monitor the running daemons? I have been loooking into DJB daemontools which seems appropriate, but are there any others that you reccomend? If DJB's daemontools is the one, could I get some more examples? I am primarily trying to keep my mail system online: postfix, cyrus, saslauthd, mysql, and spamassassin. I would advise Nagios. Sorry, I mispoke. I will be using Nagios to monitor, but I need to make sure they will restart if there is an error. Will nagios do this as well? I don't *think* so. You could write a sh script (or any other) that does this. It could contain this line: result=px aux | grep SomeDaemon | wc -l If the result is zero than SomeDaemon is not running. You'd be better off using ps auxc here (that is, print only argv[0]): $ ps aux|grep aux df 642 0,0 0,4 648 444 p1 R+8:49 0:00,00 grep aux (sh) df 641 0,0 0,3 516 392 p1 R+8:49 0:00,00 ps aux which is obviously wrong for your situation, since the aux `daemon' is not running $ ps auxc|grep auxc nothing, which is right $ And even a better solution would be to pipe the ps output to a [your favorite scripting language] script to take only the name part of the output (to avoid clash with usernames/etc.). -- Alex Articles based on solutions that I use: http://www.kruijff.org/alex/index.php?dir=docs/FreeBSD/ ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to [EMAIL PROTECTED] -- DoubleF There is a Massachusetts law requiring all dogs to have their hind legs tied during the month of April. pgp0.pgp Description: PGP signature