-
Couldn't load subscription status.
- Fork 55
Add optional daemonization #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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