Add optional daemonization#82
Conversation
|
The fork/daemonization seems to disable signal handling for some reason. |
|
moving the |
|
if the point of daemonization is systemd, maybe it would be better to adapt swayidle for Type=notiy instead ? forking is very hard to do correctly, and is not very commonly used because of that (most application that are Type=forking do not do the readyness synchronisation correctly, but still use Type=forkins to tell systemd to monitor the correct process) |
|
|
|
why not ? |
Hmm, why does the daemonization remove the signal listener? |
|
let me reiterate... from systemd's point of view, Type=notify is strictly better than Type=forking. So... why do we need that ? is it for synchronization in sysV scripts ? is it for running from some launchers ? |
I don't know, I didn't find any documentation about that. |
the signalfd man page explains why this doesn't work:
|
If the `-f` argument is passed to swayidle it will fork and daemonize after initialization. This allows proper ordering of other programs after swayidle is fully running, including Type=forking in systemd units
|
please have a read of making a daemon is "a bit" more involved than just forking... |
sure, but I don't think that's needed for swayidle. |
|
well, you should at least make sure stdin/stdout are properly handled, wihich implies you have to do the double-fork dance... |
If the
-fargument is passed to swayidle it will fork and daemonizeafter initialization. This allows proper ordering of other programs
after swayidle is fully running, including
Type=forkingin systemd units