Skip to content
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 start networking.service before network is marked online #65

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tjjh89017
Copy link

ifupdown2 didn't ensure that it will start before network.target and network-online.target.
after local-fs.target because ifupdown2 need to read config file from local filesystem
Other network services will not start after networking.service and fail because no interface is up.
(e.g isc-dhcp-server, tftp-hpa)

related to #56
related to CumulusNetworks/ifupdown2#190

Signed-off-by: Date Huang [email protected]

@tjjh89017
Copy link
Author

try to guarantee this order below (from No. 3 to 5)

  1. execute [email protected] (load driver, let Linux can see those port)
  2. reach network-pre.target
  3. execute networking.service (load config. if ports and config are mismatch, it will fail)
  4. reach network.target
  5. execute other service which need network (e.g. isc-dhcp-server)

Copy link
Contributor

@paulmenzel paulmenzel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the explanation, and excuse my ignorance.

So DentOS ships ifupdown2 1.2.8.-1from some non-official package archive, as Debian 9 (stretch) only ships 1.0~git20170314-1. The systemd units are the same in the current version 3.0.0-1, and there are no similar bug reports in the Debian BTS.

The line

related to CumulusNetworks/ifupdown2#190

could be improved by using

Upstream ifupdown2 issue: CumulusNetworks/ifupdown2#190

I am always wondering, why such issues have not been reported for other environments yet.

As commented, I’d copy the ordering dependency from ifupdown, which is I guess better tested.

@@ -1,2 +1,3 @@
[Unit]
After=network-pre.target
After=local-fs.target network-pre.target
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of local-fs.target maybe use sysinit.target (bootup(7)), and remove the DefaultDependencies=no?

@@ -1,2 +1,3 @@
[Unit]
After=network-pre.target
After=local-fs.target network-pre.target
Before=shutdown.target network.target network-online.target
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add to the commit message, that ifupdown is doing the same:

Requires=ifupdown-pre.service
Wants=network.target
After=local-fs.target network-pre.target apparmor.service systemd-sysctl.service systemd-modules-load.service ifupdown-pre.service
Before=network.target shutdown.target network-online.target
Conflicts=shutdown.target

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I just tried to follow ifupdown's config to setup this.
Thanks
I will add those commit message next time!

@tjjh89017
Copy link
Author

Thank you for the explanation, and excuse my ignorance.

So DentOS ships ifupdown2 1.2.8.-1from some non-official package archive, as Debian 9 (stretch) only ships 1.0~git20170314-1. The systemd units are the same in the current version 3.0.0-1, and there are no similar bug reports in the Debian BTS.

I talked to Cumulus engineer which is maintainer of ifupdown2 directly and didn't send this issue to BTS.
Proxmox VE also supported ifupdown2 for replacement, but didn't have this issue.
My friend, Cumulus engineer, said there might be some other dependencies or mechanisms to avoid this problem.
But if service is simple, this will cause problem (e.g. in my environment, I only installed isc-dhcp-server and ifupdown2)

It seems some users just report it to upstream repo instead of BTS.
CumulusNetworks/ifupdown2#30

The line

related to CumulusNetworks/ifupdown2#190

could be improved by using

Upstream ifupdown2 issue: CumulusNetworks/ifupdown2#190

Thanks for advice

I am always wondering, why such issues have not been reported for other environments yet.

As commented, I’d copy the ordering dependency from ifupdown, which is I guess better tested.

I'm not sure we should take all service dependencies from ifupdown2 or not.
Some systemd.target s or service are not always available in system.

Thanks for those advice!

ifupdown2 didn't ensure that it will start before network.target and network-online.target.
after local-fs.target because ifupdown2 need to read config file from local filesystem
Other network services will not start after networking.service and fail because no interface is up.
(e.g isc-dhcp-server, tftp-hpa)

Signed-off-by: Date Huang <[email protected]>
@tjjh89017
Copy link
Author

This issue has been fixed in upstream CumulusNetworks/ifupdown2#190
But they didn't release a new version and publish to Debian package currently.
So we could still have workaround here and wait for Cumulus.

@KanjiMonster
Copy link
Contributor

Is this still needed? If yes, it needs to be updated for buster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants