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

make "networkctl status" show logs related to the specified iface #14050

Closed
tomfitzhenry opened this issue Nov 16, 2019 · 3 comments · Fixed by #14488
Closed

make "networkctl status" show logs related to the specified iface #14050

tomfitzhenry opened this issue Nov 16, 2019 · 3 comments · Fixed by #14488
Labels
network RFE 🎁 Request for Enhancement, i.e. a feature request

Comments

@tomfitzhenry
Copy link
Contributor

tomfitzhenry commented Nov 16, 2019

systemd version the issue has been seen with

systemd 243

Used distribution

NixOS 19.09 and NixOS master

Expected behaviour you didn't see

systemd-networkd should listen on 67/udp.

Unexpected behaviour you saw

systemd-networkd did not listen on 67/udp

With hindsight, this systemd-networkd warning is relevant:

systemd-networkd[489]: Failed to determine timezone: No such file or directory

Steps to reproduce the problem

[Match]
Name=eth0

[Network]
DHCPServer=true
Address=10.0.0.1/24

[DHCPServer]
DNS=10.0.0.1
PoolOffset=100

NixOS/nixpkgs#73505 has an automated test to reproduce this, executable via https://nixos.org/nixos/manual/index.html#sec-running-nixos-tests-interactively .

Mechanism

In systemd 242, systemd would create /etc/localtime and systemd-networkd would grab timezone info from /etc/localtime as part of being a DHCP server. Everything is good so far.

systemd 243 introduced 09bef96, which removed the creation of /etc/localtime, and thus systemd-networkd fails to get timezone data, and thus fails to start a DHCP server. In particular, not listening on 67/udp.

bc9ecd4 will fix this by falling back to UTC if /etc/localtime does not exist.

Workaround
Set EmitTimezone=false under [DHCPServer].

Context

Tracked in NixOS at NixOS/nixpkgs#73504 .

@tomfitzhenry
Copy link
Contributor Author

tomfitzhenry commented Nov 16, 2019

Though it looks like bc9ecd4 fixes this in HEAD, I've raised this bug to give awareness to others experiencing this issue, and to track:

  • this being mentioned in NEWS (?)
  • turning a warning into an error, which would h ave allowed me to more quickly diagnose this on my machine.

@poettering
Copy link
Member

So yeah, bc9ecd4 coincidentally fixes this.

We usually don't mention bugfixes in NEWS. It'd simply be too many, NEWS is supposed to be for the highlights, i.e. feature additoins. If you want the full list of changes including bugfixes "git shortlog" is really the best option.

I am also tempted to say that the networkd should probably continue to warn but continue if we cannot initialize the DHCP server. Logging at error usually means something is withing some specific context fatal, but I don#t think this should be made fatal.

Instead, maybe we should turn this into an RFE that makes "networkctl status $IFACE" show the most recent logs for that interface among its output similar to how "systemctl status" does that for services. if we had that it would be easy to find this kind of stuff...

@poettering poettering added dhcp network RFE 🎁 Request for Enhancement, i.e. a feature request labels Nov 18, 2019
@poettering poettering changed the title DHCPServer only starts if /etc/localtime exists make "networkctl status" show logs related to the specified iface Nov 18, 2019
@tomfitzhenry
Copy link
Contributor Author

We usually don't mention bugfixes in NEWS. It'd simply be too many, NEWS is supposed to be for the highlights, i.e. feature additoins. If you want the full list of changes including bugfixes "git shortlog" is really the best option.

Fair.

I am also tempted to say that the networkd should probably continue to warn but continue if we cannot initialize the DHCP server. Logging at error usually means something is withing some specific context fatal, but I don#t think this should be made fatal.

a0fa3ef has already changed the warnings into errors, but if that isn't consistent with the rest of the source's log levels, I can see why you might want to revert it. Perhaps those warning messages could be modified to include the causal link between failure to get timezone, and DHCP server not starting.

e.g.

"Failed to determine timezone: %m"

might become

"Failed to determine timezone, refusing to start DHCP server: %m"

or some such?

Instead, maybe we should turn this into an RFE that makes "networkctl status $IFACE" show the most recent logs for that interface among its output similar to how "systemctl status" does that for services. if we had that it would be easy to find this kind of stuff...

Yes, that sounds useful, and the consistency with 'systemctl status' makes it easy to understand and expected.

yuwata added a commit to yuwata/systemd that referenced this issue Jan 6, 2020
@yuwata yuwata added has-pr ✨ and removed dhcp labels Jan 6, 2020
yuwata added a commit to yuwata/systemd that referenced this issue Jan 6, 2020
yuwata added a commit to yuwata/systemd that referenced this issue Jan 7, 2020
yuwata added a commit to yuwata/systemd that referenced this issue Jan 7, 2020
yuwata added a commit to yuwata/systemd that referenced this issue Jan 7, 2020
yuwata added a commit to yuwata/systemd that referenced this issue Jan 7, 2020
yuwata added a commit to yuwata/systemd that referenced this issue Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
network RFE 🎁 Request for Enhancement, i.e. a feature request
Development

Successfully merging a pull request may close this issue.

3 participants