On Tue, Mar 06, 2012 at 04:01:47PM -0500, Wietse Venema wrote:

> So you need a way for "postfix start" that returns status 0 if the
> master(8) daemon initalizes successfully, and non-zero otherwise.
> 
> I think this can be done by starting the master as a foreground
> process.  The foreground master forks a child process that will
> become the master daemon that runs as a background process. 
> 
> The foreground master process waits for the "all is OK" signal from
> the child process. When that happens, the foreground process
> terminates with a 0 status, causing "postfix start" to return a 0
> status.  This will normally take a fraction of a second.
> 
> In case of problems (no response from child, child terminates) the
> foreground process terminates with non-zero status, and "postfix
> start" reports an error, and returns a non-zero exit status.
> 
> Will that work?

It'll could be an inconvenience for the folks at Apple, who start
master(8) directly via launchd.  However, since they've made no
attempt to have their patches adopted, ...  it is hard to take
their interests into account. Probably provided "master -d" continues
to run in the foreground, their stuff will not break in new ways. :-)

-- 
        Viktor.

Reply via email to