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

network: Restore KeepConfiguration=dhcp-on-stop #30

Merged
merged 1 commit into from Nov 12, 2020

Conversation

pothos
Copy link
Member

@pothos pothos commented Nov 9, 2020

The default behavior in systemd-networkd was changed in v244 from
keeping the IP addresses and routes on service stop to deconfiguring
them:
systemd/systemd@8006035
Deconfiguring means that on system shutdown the DHCP address is
properly released but also has the side effect that orphaned processes
not part of a systemd unit don't have network connectivity when they
get the broadcasted SIGTERM.
Restore the previous behavior and hope that DHCP servers recognize
the system again on reboot and hand out the same address don't have to
rely on the address release (which, anyway, is not sent for a crashing
system either). The default can of course be changed by the user.
In the initramfs the KeepConfiguration=no behavior is desired because
otherwise the IP address is not released which can cause problems when
a different DHCP client configuration is set on first boot and the DHCP
server wouldn't be able to recognize the rootfs system and keep two
addresses allocated.

Fixes flatcar/Flatcar#213

How to use/test

Boot a system that uses one of the modified configurations, e.g., a QEMU VM.
Then check

systemctl stop systemd-networkd
ip a

to report the interface as configured with an IP address.

Testing done

Manually changed the default config in a QEMU VM.
Ran kola tests on all platforms. Verified that stopping networkd does not turn of QEMU networking.

@pothos pothos requested a review from a team Nov 9, 2020
The default behavior in systemd-networkd was changed in v244 from
keeping the IP addresses and routes on service stop to deconfiguring
them:
systemd/systemd@8006035
Deconfiguring means that on system shutdown the DHCP address is
properly released but also has the side effect that orphaned processes
not part of a systemd unit don't have network connectivity when they
get the broadcasted SIGTERM.
Restore the previous behavior and hope that DHCP servers recognize
the system again on reboot and hand out the same address don't have to
rely on the address release (which, anyway, is not sent for a crashing
system either). The default can of course be changed by the user.
In the initramfs the KeepConfiguration=no behavior is desired because
otherwise the IP address is not released which can cause problems when
a different DHCP client configuration is set on first boot and the DHCP
server wouldn't be able to recognize the rootfs system and keep two
addresses allocated.

Fixes flatcar/Flatcar#213
@pothos pothos force-pushed the kai/keep-address-on-networkd-stop branch from a509898 to 0b6e6fe Compare Nov 9, 2020
pothos added a commit to flatcar/coreos-overlay that referenced this pull request Nov 10, 2020
Pulls in
flatcar/coreos-cloudinit#10
flatcar/init#30
to restore the systemd-networkd 243 behavior with
KeepConfiguration=dhcp-on-stop to prevent the network from going down
before the SIGTERM is broadcasted to orphaned processes not part of a
systemd unit.
t-lo
t-lo approved these changes Nov 12, 2020
Copy link
Member

@t-lo t-lo left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@pothos pothos merged commit 365cfc7 into flatcar-master Nov 12, 2020
@pothos pothos deleted the kai/keep-address-on-networkd-stop branch Nov 12, 2020
pothos added a commit to flatcar/coreos-overlay that referenced this pull request Nov 12, 2020
Pulls in
flatcar/coreos-cloudinit#10
flatcar/init#30
to restore the systemd-networkd 243 behavior with
KeepConfiguration=dhcp-on-stop to prevent the network from going down
before the SIGTERM is broadcasted to orphaned processes not part of a
systemd unit.
dongsupark pushed a commit to flatcar/coreos-overlay that referenced this pull request Nov 13, 2020
Pulls in
flatcar/coreos-cloudinit#10
flatcar/init#30
to restore the systemd-networkd 243 behavior with
KeepConfiguration=dhcp-on-stop to prevent the network from going down
before the SIGTERM is broadcasted to orphaned processes not part of a
systemd unit.
dongsupark pushed a commit to flatcar/coreos-overlay that referenced this pull request Nov 13, 2020
Pulls in
flatcar/coreos-cloudinit#10
flatcar/init#30
to restore the systemd-networkd 243 behavior with
KeepConfiguration=dhcp-on-stop to prevent the network from going down
before the SIGTERM is broadcasted to orphaned processes not part of a
systemd unit.
pothos added a commit to flatcar/coreos-overlay that referenced this pull request Dec 3, 2020
Pulls in
flatcar/coreos-cloudinit#10
flatcar/init#30
to restore the systemd-networkd 243 behavior with
KeepConfiguration=dhcp-on-stop to prevent the network from going down
before the SIGTERM is broadcasted to orphaned processes not part of a
systemd unit.
jepio pushed a commit that referenced this pull request Feb 21, 2022
network: Enable the RAs to fix IPv6 address assignment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants