fix: check if dhcpcd is running before querying DHCP#2800
Open
raman1236 wants to merge 1 commit into
Open
Conversation
On Ubuntu 24.04, dhcpcd-base is installed as a dependency of cloud-init and ubuntu-minimal, but the dhcpcd daemon is not running. The dhcpcd -U command logs 'dhcpcd is not running' to syslog for every network interface, which produces excessive noise in system logs. Check for common dhcpcd PID file locations before attempting to run dhcpcd -U. The check is cached for the lifetime of the resolver so it only happens once per facter run. Fixes puppetlabs#2780
Contributor
|
Hi @raman1236, |
Author
|
Friendly ping — this PR adds a check for whether |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Fixes facter spamming "dhcpcd is not running" to syslog on Ubuntu 24.04 for every network interface.
Problem
On Ubuntu 24.04,
dhcpcd-baseis installed as a dependency ofcloud-initandubuntu-minimal, but thedhcpcddaemon is not running. The DHCP resolver callsdhcpcd -U <interface>for every network interface, which logs "dhcpcd is not running" to syslog each time.Fix
Before calling
dhcpcd -U, check if dhcpcd is actually running by looking for its PID file in common locations:/run/dhcpcd.pid/var/run/dhcpcd.pid/run/dhcpcd/pid/var/run/dhcpcd/pidThe check is cached for the lifetime of the resolver so it only happens once per facter run.
Fixes #2780