Re: automatically restarting dying daemons?
On Wed, Jun 30 at 06:25PM -0400, Derrick 'dman' Hudson wrote:
> On Wed, Jun 30, 2004 at 04:34:06PM -0500, Will Trillich wrote:
> | problem: xinetd, after working just fine and dandy for weeks at
> | a time, gets dozens of "unexpected signal" (source unknown)
> | and gives up the ghost.
> |
> | questions:
> | 1) what's the best way (e.g. debian way) to monitor active
> | daemons and restart them when necessary? maybe some
> | utility already exists for this? or /proc/something?
> | or `ps ax`?
>
> restartd.
aha. not available for woody, but it's available for sarge...
the logging is odd (stdout, even with /etc/init.d/restartd
restart? is this thing finished?) but it does what we want it to
do.
# lsof | grep ^restartd
restartd 12689 root cwd DIR 3,1 4096 15387 /etc/webmin
restartd 12689 root rtd DIR 3,1 4096 2 /
restartd 12689 root txt REG 3,6 9008 65286 /usr/sbin/restartd
restartd 12689 root mem REG 3,1 90152 46147 /lib/ld-2.3.2.so
restartd 12689 root mem REG 3,1 1243856 46185 /lib/libc-2.3.2.so
restartd 12689 root 0u CHR 136,0 2 /dev/pts/0
restartd 12689 root 1u CHR 136,0 2 /dev/pts/0
restartd 12689 root 2u CHR 136,0 2 /dev/pts/0
restartd 12689 root 3u unix 0xcb92b330 199392 socket
descriptors 0, 1, 2 are pts/0! for a daemon?
# lsof | grep pts/
bash 5179 will 0u CHR 136,0 2 /dev/pts/0
bash 5179 will 1u CHR 136,0 2 /dev/pts/0
bash 5179 will 2u CHR 136,0 2 /dev/pts/0
bash 5179 will 255u CHR 136,0 2 /dev/pts/0
bash 5310 root 0u CHR 136,0 2 /dev/pts/0
bash 5310 root 1u CHR 136,0 2 /dev/pts/0
bash 5310 root 2u CHR 136,0 2 /dev/pts/0
bash 5310 root 255u CHR 136,0 2 /dev/pts/0
restartd 12689 root 0u CHR 136,0 2 /dev/pts/0
restartd 12689 root 1u CHR 136,0 2 /dev/pts/0
restartd 12689 root 2u CHR 136,0 2 /dev/pts/0
lsof 13050 root 0u CHR 136,0 2 /dev/pts/0
lsof 13050 root 2u CHR 136,0 2 /dev/pts/0
grep 13051 root 1u CHR 136,0 2 /dev/pts/0
grep 13051 root 2u CHR 136,0 2 /dev/pts/0
lsof and grep are running at my terminal; so is bash... but
restartd was launched as a daemon! eesh.
[hmm -- must look into the /etc/init.d/restartd script to make
sure it's properly launched there.... hmm]
plus, whatever it does restart (according to configs, of course)
winds up with file descriptors open to /var/run/restartd...
# lsof | grep run/restartd
spamd 12752 root 4w REG 3,5 382 294355 /var/run/restartd
postmaste 12901 postgres 4w REG 3,5 382 294355 /var/run/restartd
postmaste 12906 postgres 4w REG 3,5 382 294355 /var/run/restartd
postmaste 12908 postgres 4w REG 3,5 382 294355 /var/run/restartd
named 13013 bind 4w REG 3,5 382 294355 /var/run/restartd
named 13014 bind 4w REG 3,5 382 294355 /var/run/restartd
named 13015 bind 4w REG 3,5 382 294355 /var/run/restartd
named 13016 bind 4w REG 3,5 382 294355 /var/run/restartd
named 13017 bind 4w REG 3,5 382 294355 /var/run/restartd
weird. but operational.
thanks for the pointer!
--
I use Debian/GNU Linux version 3.0;
Linux boss 2.4.18-bf2.4 #1 Son Apr 14 09:53:28 CEST 2002 i586 unknown
DEBIAN NEWBIE TIP #62 from Will Trillich <will@serensoft.com>
:
Wouldn't it be nice to SEE YOUR TABS WHILE YOU EDIT? With Vim,
you can do this with
:set listchars=tab:+-,trail:$
:set list
and format them via ":highlight NonText ...". (See ":help listchars"
and ":help highlight" for more info.) Put them in your ~/.vimrc if
you decide you like that setup.
Also see http://newbieDoc.sourceForge.net/ ...
Reply to: