Re: Heads Up: FESCo is considering to block packages providing sysvinit services without systemd unit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 11.11.11 14:12, Miloslav Trmač (mitr@xxxxxxxx) wrote:

> On Fri, Nov 11, 2011 at 2:05 PM, Lennart Poettering
> <mzerqung@xxxxxxxxxxx> wrote:
> > Note that only double-forking
> > will properly detach a process from the parent it is started from on
> > Unix, and hence is not an option but mandatory to do
> 
> In the traditional SysV, the process executing /etc/init.d/$service
> will exit immediately afterwards.  Isn't that structurally equivalent
> to double-forking within the service?

No.

In SysV it is expected that when you run "/etc/init.d/foobar start" and
this command completes the service is fully initialized, the PID file
written and the service accessible. That means that you need to double
fork and in the parent process wait until initialization is
complete. That won't work if you leave the second fork to the invoking
shell, since the shell will have it much harder to wait until the
service initialization completed. 

On top of that, you need to invoke setsid() between the two forks, which
you can't really do if you only have one fork().

Please have a look at the check list in daemon(7).

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux