|
|
Subscribe / Log in / New account

Distributors ponder a systemd change

Distributors ponder a systemd change

Posted Jun 8, 2016 16:05 UTC (Wed) by mezcalero (subscriber, #45103)
Parent article: Distributors ponder a systemd change

Small technical correction: logind/PID1 actually *do* send SIGHUP to the session processes (in addition to SIGTERM) when trying to terminate them. That's because shells block SIGTERM and only terminate on SIGHUP.

Lennart


to post comments

Distributors ponder a systemd change

Posted Jun 8, 2016 20:46 UTC (Wed) by pbonzini (subscriber, #60935) [Link] (5 responses)

Would that cause problems if some daemon rereads the configuration file and it had changed in ways that the user want yet expecting to be activated? (For example he wanted to change two configuration files and then restart two services, but his SSH session got terminated midway).

Distributors ponder a systemd change

Posted Jun 9, 2016 0:54 UTC (Thu) by anselm (subscriber, #2796) [Link] (4 responses)

Daemons, by definition, have no business running in user sessions. SIGHUP is used to prod daemons to reread their configuration exactly because they don't have a controlling terminal and are therefore immune against the original use of SIGHUP, namely their session going away – this means that, for a daemon, the signal is available to be used for this.

Distributors ponder a systemd change

Posted Jun 9, 2016 10:04 UTC (Thu) by pbonzini (subscriber, #60935) [Link] (3 responses)

Then why does gpg-agent reread the configuration file if it receives SIGHUP? And that's just the first manpage I opened...

Distributors ponder a systemd change

Posted Jun 9, 2016 11:21 UTC (Thu) by HenrikH (subscriber, #31152) [Link] (2 responses)

Because gpg-agent is a daemon although it's invoked by the user and not by init.

Distributors ponder a systemd change

Posted Jun 9, 2016 11:24 UTC (Thu) by pbonzini (subscriber, #60935) [Link] (1 responses)

Hence the parent assertion that "Daemons, by definition, have no business running in user sessions" is wrong.

Distributors ponder a systemd change

Posted Jun 9, 2016 19:52 UTC (Thu) by HenrikH (subscriber, #31152) [Link]

Well there can always be exceptions to a rule, the most dangerous words are "always" and "never" :-). However something like ssh-agent should be a prime candidate for the systemd socket activation feature, however that might create problems on a multi-user system (I don't know since I have not looked at ssh-agent at all).

Distributors ponder a systemd change

Posted Jun 9, 2016 10:48 UTC (Thu) by diegor (subscriber, #1967) [Link] (1 responses)

I wonder if it would be better to use sighup alone. More or less that is the reasong sighup is exist: "dear process, your user is no more there".

Another question: what does it happens if the process just ignore sigterm?

Distributors ponder a systemd change

Posted Jun 9, 2016 11:22 UTC (Thu) by HenrikH (subscriber, #31152) [Link]

Then it gets killed with SIGKILL


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds