scheduler: avoid waiting for stdout eof of /etc/network/ scripts #274
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
As mentioned in the commit message, this patch is intended to increase compatibility with ifupdown with regards to how
/etc/network/
scripts are run (see commit message for a simple example).It also fixes an issue where a Debian 12 host hangs indefinitely on boot if current
ifupdown2
master as well as the packagesntpsec
andntpsec-ntpdate
are installed.The hang happens because
ntpsec-ntpdate
installs a script/etc/network/if-up.d/ntpsec-ntpdate
-- the following excerpt is relevant:The
invoke-rc.d
call amounts tosystemctl start ntpsec
, so the script essentially runssystemctl start ntpsec
in a background subshell. Unfortunately this command blocks indefinitely (see below). Since ifupdown2 waits for stdout end-of-file, it waits for the command to terminate even though it is run in a background subshell. As a result, the boot process hangs indefinitely. I presume thesystemctl start ntpsec
command blocks indefinitely because ntpsec.service setsWants=network.target
, butnetwork.target
will only become available whenifupdown2
finishes, which it never does. Withifupdown
instead ofifupdown2
, the boot does not hang as the blocking command is executed in the background.I guess the hang issue can also be fixed by patching the unit file of
ntpsec
and/or the network script ofntpsec-ntpdate
-- to be honest I have not dug deep enough yet to fully grasp the network script. As this PR also increases compatibility with ifupdown, I decided to send it here anyway. Let me know what you think.Thanks and best wishes,
Friedrich