PEACEFUL systemd thread - GNU/Linux

Users browsing this thread: 2 Guest(s)
venam
Administrators
(15-06-2017, 04:02 PM)z3bra Wrote: I disagree with you there. It is only said so because orphaned programs get adopted by PID 1. Proper service handling can be done by any process, as long as their children don't double fork themselves (which they shouldn't do on their own anyway).

Yes, it doesn't have to but it's easier to do that from PID1.
In the case where it's not it could still fulfill the following:
  • Be detached from a terminal
  • Don't have any way to reacquire one (SID != PID, maybe the service manager (not PID1) will be able to reacquire one)
  • Be immune to signals that would interfere with it (example: sent to the group instead of to it directly)
  • Have the environmental values reset (no file descriptor, reset masks, cwd to /, etc..)
In the case of a daemon that is started by a service manager that is not PID 1 the SID and GID will be the one of that service manager.
Thus it's subject to signals sent to that group. And if the service manager dies (which would not happen with PID1) then all the services will become orphan.

Those are not too big of an issue, you're right, it doesn't have to be PID 1.

Here's a thread that discusses this a bit: https://unix.stackexchange.com/questions...472#197472
Another one that talks about orphaned process not necessarily being reparented to PID 1 and thus could be reparented to that service-manager https://unix.stackexchange.com/questions...361#177361

The discussion is going a bit off-rails, sorry for that.


Messages In This Thread
PEACEFUL systemd thread - by z3bra - 30-10-2016, 05:49 AM
RE: PEACEFUL systemd thread - by jkl - 30-10-2016, 01:05 PM
RE: PEACEFUL systemd thread - by pranomostro - 30-10-2016, 05:17 PM
RE: PEACEFUL systemd thread - by venam - 31-10-2016, 03:43 AM
RE: PEACEFUL systemd thread - by z3bra - 31-10-2016, 10:03 AM
RE: PEACEFUL systemd thread - by evbo - 31-10-2016, 01:51 PM
RE: PEACEFUL systemd thread - by z3bra - 02-11-2016, 05:38 AM
RE: PEACEFUL systemd thread - by evbo - 02-11-2016, 03:17 PM
RE: PEACEFUL systemd thread - by z3bra - 03-11-2016, 01:07 PM
RE: PEACEFUL systemd thread - by TheAnachron - 03-11-2016, 01:45 PM
RE: PEACEFUL systemd thread - by josuah - 03-11-2016, 03:11 PM
RE: PEACEFUL systemd thread - by pranomostro - 03-11-2016, 03:32 PM
RE: PEACEFUL systemd thread - by z3bra - 15-06-2017, 06:16 AM
RE: PEACEFUL systemd thread - by azk - 15-06-2017, 10:06 AM
RE: PEACEFUL systemd thread - by evbo - 15-06-2017, 12:32 PM
RE: PEACEFUL systemd thread - by z3bra - 15-06-2017, 02:35 PM
RE: PEACEFUL systemd thread - by venam - 15-06-2017, 02:49 PM
RE: PEACEFUL systemd thread - by z3bra - 15-06-2017, 03:36 PM
RE: PEACEFUL systemd thread - by venam - 15-06-2017, 03:51 PM
RE: PEACEFUL systemd thread - by z3bra - 15-06-2017, 04:02 PM
RE: PEACEFUL systemd thread - by venam - 16-06-2017, 01:01 AM
RE: PEACEFUL systemd thread - by z3bra - 16-06-2017, 05:00 AM
RE: PEACEFUL systemd thread - by venam - 16-06-2017, 07:14 AM
RE: PEACEFUL systemd thread - by z3bra - 16-06-2017, 02:14 PM
RE: PEACEFUL systemd thread - by grah - 26-02-2019, 11:50 PM