Add option to upsmon to run in foreground#349
Add option to upsmon to run in foreground#349schaal wants to merge 11 commits intonetworkupstools:masterfrom
Conversation
|
@aquette @clepple @peterhoeg : does this seem reasonable to you? To me seems ok - reduces dependency on PID files and reduces forking ;) |
|
@jimklimov if we are going to change the forking behavior, I would prefer that all of the daemons have similar options added at the same time. I also haven't looked to see how this works on a live system when upsmon forks off the unprivileged child. Hopefully, systemd only complains about the combination of This has been pretty low on my priority list, though - I have been running components of NUT in the foreground for the last several years under OS X |
|
We've had some talk about this at https://github.com/NixOS as well, because there are pros and cons. Systemd will consider a Historically, for services that did the pidfile/double-forking dance, they would typically only fork when all the setup had been completed which is when systemd will say "OK, this is running". Systemd will then only start executing dependant services when the parent is actually up. In the If that brief gap is not an issue, I'd say go for it and run in the foreground but that is a call only you can make. The other option is to make use of Reference: |
|
@peterhoeg I probably should have been more specific. Agreed that this pull request adds an option to bypass one of the two forks. The current systemd response to that can be tested by the |
|
@clepple, I haven't tried your code, but when running as
|
93db9c5 to
7f7cb18
Compare
I also added this option to upsd and drivers now, adding this to upsdrvctl seems more complicated.
I tried this and systemd correctly supervises both the parent and the child process |
|
I rebased this PR on current master, is there anything else that's blocking this? |
|
Good point, now I wonder how it is in "competing" PRs. We have several on
this subject, some from myself, and some for different components, so I
intend to juggle the existing proposals into a consistent solution with
things named and behaving the same in different daemons we have in NUT.
Sounds like the way to go!
|
…g_min' This merge unites two similarly targeted PRs: Closes: networkupstools#683 Closes: networkupstools#349
|
This PR was finally devoured by #683 which originally introduced related separation of debug vs backgrounding, as well as config-file provided debug levels. |
Add an option to upsmon to run in foreground without raising the debug level. Use this option to run upsmon when using systemd. (see also #123 and #821 and #683)