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

Add debug logging for system state changes #175

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

agowa
Copy link
Contributor

@agowa agowa commented Jan 24, 2023

Add logging for reading and writing to system files including /proc

Klaus Frank and others added 3 commits January 24, 2023 06:42
Add logging for reading and writing to system files including /proc
src/ipv6nd.c Outdated Show resolved Hide resolved
@rsmarples
Copy link
Member

@agowa338 This is adding an awful lot of debug to dhcpcd and it has plenty already. What specifically are we trying to debug here? You must have had a reason to do this.

I'm happy to take the code in that adjusts comments in the headers and any other non debug related improvements in a separate PR.

@igalic
Copy link

igalic commented May 3, 2023

this looks like a level of detail where you might as well use DTrace for

(or eBPF on Linux these days?)

@agowa
Copy link
Contributor Author

agowa commented May 8, 2023

The reason was that dhcpcd was changing system configuration that I had explicitely defined otherwise (and it doing so caused service disruptions). So I wasted excessive time trying to understand why sysctl is not applying it. I ran everything with debug output, but dhcpcd didn't log anything, so I was assuming that it didn't change anything and wasted a lot of time trying to debug and find what application actually touched it...

@rsmarples
Copy link
Member

What sysctls are we talking about here that would cause a service distruption? dhcpcd will change the following IPv6 related tunables:

  • disables the kernel from making it's own IPv6 LL addresses because it will make it's own stable private address.
  • disables the kernel from doing autoconf or accept_ra because dhcpcd will do it instead
  • adjust interface tunables for hop limit, retrans and reachable based on RA received

You can stop dhcpcd from doing this by disabling IPv6 or IPv6RS support in dhcpcd.

Otherwise I'm not sure what else dhcpcd would stamp on and cause a problem?

@agowa
Copy link
Contributor Author

agowa commented May 8, 2023

It has been a while, but if I recall correctly, it was an interaction between multiple settings (at least accept_ra and forwarding) that caused the disruption.

The system was used to run containers (I.E. forwarding was enabled). But dhcpcd set accept_ra to 1 (or 0, don't know anymore), whereas I had set it to 2 within a startup task explicitly. Other systems on the same lan were advertising their internal container/vm/vpn/... networks, so that traffic to them was routed directly instead of to the gateway (which filtered it).

And disabling dhcpcd was not an option, because I needed it to get me a prefix using DHCP-PD...

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.

None yet

3 participants