Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 03 Sep 2003 15:55:44 -0400
From:      Chuck Swiger <cswiger@mac.com>
To:        David Banning <david+dated+1063050181.812806@skytracker.ca>
Cc:        questions@freebsd.org
Subject:   Re: how to run a program as a daemon
Message-ID:  <3F564740.5050704@mac.com>
In-Reply-To: <20030903194259.GA23225@skytrackercanada.com>
References:  <20030903194259.GA23225@skytrackercanada.com>

next in thread | previous in thread | raw e-mail | index | archive | help
David Banning wrote:
> I am running tmda-ofmipd for my smtp server and occasionally
> it dies. I wonder how I could set it up to run so that if it
> dies for some reason, it will start up again. Right now, it 
> starts in my rc.local like so;
> 
> /usr/local/bin/tmda-ofmipd  -R imap://localhost -u tofmipd

Look at DJB's daemontools, perhaps.  But the general idea is that you have a 
monitor script which looks like:

#! /bin/sh

while : ; do
    /usr/local/bin/tmda-ofmipd  -R imap://localhost -u tofmipd
    echo "TMDA daemon died!  Restarting in 5 seconds..."
    sleep 5
done

-- 
-Chuck




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