On 5/16/05, Giorgos Keramidas <[EMAIL PROTECTED]> wrote:
> On 2005-05-16 18:48, "Sergey S. Ropchan" <[EMAIL PROTECTED]> wrote:
> > Monday, May 16, 2005, 6:41:03 PM, you wrote:
> > > Hi,
> > > I want to know how can I programmatically restart a dead daemon
> > > process in Unix?
> >
> > You can restart daemon process with:
> >
> > kill -HUP `cat /path/to/processname.pid`
> 
> Note the daemon is 'dead'.  You can't signal a dead process.
> 

Hehe.  Perhaps what you want is a cron job that runs a shell script
every 5 mins or so.  The shell script can check for the pid file and
if it does not exist then it restarts the daemon.  If it does find the
pid file then it will probably want to then check if the daemon is
running or not, just incase it died and never cleaned up.  Again if no
process with that pid exists it can restart the daemon.  There are
probably better ways but this is pretty simple.

Chris
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to