-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix daemonize #2783
Fix daemonize #2783
Conversation
To be honest, I don't know enough about services to understand whether your change makes sense or not: it was initially contributed in #306, meaning it's been in the documentation for 6 years already, which suggests it's been working for most people just fine so far. As such, I'm hesitant to accept a change that may very well be a fix just for you and break it for others. Can you elaborate on why you're suggesting this change, and what exactly it does? |
Hi, It might be perhaps just a fix for me but there is no any harm replacing "simple" with "idle" according to the system.service manual : "Behavior of idle is very similar to simple; however, actual execution of the service program is delayed until all active jobs are dispatched. This may be used to avoid interleaving of output of shell services with the status output on the console. Note that this type is useful only to improve console output, it is not useful as a general unit ordering tool, and the effect of this service type is subject to a 5s timeout, after which the service program is invoked anyway" I'm surprised that during 6 years there were no notifications on, perhaps those few, like me, that encountered it have just fixed it without giving feedback. Nevertheless, I admit that this fix is just a workaround for the real problem: why "After=network.target" directive is not respected during boot (in my case at least) ? Investigating further I'm realising that "network.target" is not correct. This is what I'm finding on 4 more recent different linux versions that I checked now (Ubuntu 20.x, 16.x, Debian 10.x and 9.x). In this case there is no need for the "idle" workaround, the system.service manual recommends anyway "simple" for general usage: "It is generally recommended to use Type=simple for long-running services whenever possible..." According to the above the correct service script is (which is working perfectly now) : [Unit] [Service] [Install] |
What is the difference between network and network-online ? I forgot, did Janus guess its own IP with STUN at boot? In that case it would make sense yeah. Whit that fixed, would the change from simple to idle be necessary? In the affirmative, I'd appreciate a throrough commit message explaining why, since it's quite non-obvious. |
The "network.target" is non existent in /etc/systemd/system/, probably name change since the original commit. After=network-online.target No, there is no need for "idle" in this case, that was just a workaround to force delaying the start of janus at boot time, which failed with "simple" using "network.target", since it was not waiting for the network being up. I did not realized that "network.target" was non existent. |
I just did some search and found https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ that explains the difference between
|
So the right fix for the docs is changing the network.target line? No problem for me to add a couple of sentences that say what you found out, i.e., about different versions of some OS that may require a different naming. As soon as the patch is updated with the suggestions in the comments, this is good to merge for me 👍 |
The commit for amending the mainpage.dox is now updated according to this conversation. In the systemd service script example of the documentation for controlling Janus daemon, the "network.target" is replaced by "network-online.target" for fixing a startup issue at boot time. This last is ensuring that the system service actively waits until the network is "up" while the former was not guaranteeing it, the Janus server failing to start at boot time in particular cases. According to the recommendations within the conversation group and in https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ the service script now includes: After=network-online.target ensuring that at boot time the Janus daemon starts after the network is fully up. |
Thanks, merging then! 👍 |
To test