From owner-freebsd-questions Wed Jun 30 9:53:18 1999 Delivered-To: freebsd-questions@freebsd.org Received: from inet.chip-web.com (c1003518-a.plstn1.sfba.home.com [24.1.82.47]) by hub.freebsd.org (Postfix) with SMTP id DC5FF1555C for ; Wed, 30 Jun 1999 09:53:14 -0700 (PDT) (envelope-from ludwigp@bigfoot.com) Received: (qmail 1007 invoked from network); 30 Jun 1999 16:53:13 -0000 Received: from speedy.chip-web.com (HELO speedy) (172.16.1.1) by inet.chip-web.com with SMTP; 30 Jun 1999 16:53:13 -0000 Message-Id: <4.1.19990630094901.00aa22d0@mail-r> X-Sender: ludwigp@toy.chip-web.com (Unverified) X-Mailer: QUALCOMM Windows Eudora Pro Version 4.1 Date: Wed, 30 Jun 1999 09:53:17 -0700 To: Dan Nelson , Sodah From: Ludwig Pummer Subject: Re: monitor process Cc: freebsd-questions@FreeBSD.ORG In-Reply-To: <19990630094731.A50144@dan.emsphone.com> References: <377B7199.DF55C8F7@index.com.jo> <377B7199.DF55C8F7@index.com.jo> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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