Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jun 1999 09:53:17 -0700
From:      Ludwig Pummer <ludwigp@bigfoot.com>
To:        Dan Nelson <dnelson@emsphone.com>, Sodah <rsodah@index.com.jo>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: monitor process
Message-ID:  <4.1.19990630094901.00aa22d0@mail-r>
In-Reply-To: <19990630094731.A50144@dan.emsphone.com>
References:  <377B7199.DF55C8F7@index.com.jo> <377B7199.DF55C8F7@index.com.jo>

next in thread | previous in thread | raw e-mail | index | archive | help
At 07:47 AM 6/30/1999 , Dan Nelson wrote:
>In the last episode (Jul 01), Sodah said:
>> Greetings,
>> 
>> I have process that dies after 4 hours or more.
>> Is it possible to monitor it and make it starts again
>> in auto-mode without typing it at the prompt?
>
>what I usually do is write a small wrapper script:
>
>while : ; do
>  brokenprogram
>  sleep 10 
>done
>
>then I run that script instead of "brokenprogram".

Another options is supervise from Dan J. Berenstein's daemontools package:

ftp://koobera.math.uic.edu/www/daemontools.html
>supervise monitors a service. It starts the service and restarts the service 
>if it dies. The companion svc program stops, pauses, or restarts the service 
>on sysadmin request. The svstat program prints a one-line status report. 

It's also in the ports collection at
file://localhost/usr/ports/sysutils/daemontools

Supervise is nice because it simplifies sending signals to brokenprogram
(you don't have to track the PID) and you use the companion program 'svc'
to control starting, restarting, and killing brokenprogram.
The only problem with supervise is that it doesn't handle programs which
pre-fork (like sshd, unless you tell it you're running from inetd).

--Ludwig Pummer ( ludwigp@bigfoot.com ) ICQ UIN: 692441


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4.1.19990630094901.00aa22d0>