:: Re: [DNG] tiny service state api [W…
Etusivu
Poista viesti
Vastaa
Lähettäjä: Steve Litt
Päiväys:  
Vastaanottaja: dng
Aihe: Re: [DNG] tiny service state api [WAS: Fwd: init system agnosticism]
On Sat, 15 Apr 2017 08:14:48 +0200
marc <marcxdv@???> wrote:

> I have written up the details at
> http://welz.org.za/notes/on-starting-daemons.html


Concerning the fork-parent.c and fork-parent.h revealed at
http://welz.org.za/notes/fork-parent.tar.gz , I can't envision how
you'd bind the fork-parent() function to the stuff your daemon actually
does, in order to have your daemon properly fork and then terminate the
parent when ready for business.

I look at the code in fork-parent.c, and it looks to me like all the
actual tasks of the daemon should be placed immediately above the
child's closing p[1], so p[1] is closed when the daemon is ready. But
in fact, fork-parent() has no interface to the real work of the daemon,
as far as I can see.

So how does one bolt fork-parent() on to his or her daemon code to
enable it with proper backgrounding and timing?

Thanks,

SteveT

Steve Litt 
April 2017 featured book: Troubleshooting Techniques
     of the Successful Technologist
http://www.troubleshooters.com/techniques