From da2d73b676f1257963705a487215739a62edce83 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Wed, 18 Jul 2018 20:27:05 -0500 Subject: [PATCH] roles/dhcpcd: Disable device management module Today I realized that `dhcpcd` has been logging several hundred thousand of these messages every second: libudev: received NULL device This was causing both `dhcpcd` and `systemd-journald` to consume 100% CPU. I am not entirely sure what a "device management" module is in the context of `dhcpcd`, but it does not seem to be required. Setting the `nodev` option in `dhcpcd.conf` suppresses the messages, and seems to have no effect on the operation of the daemon. --- roles/dhcpcd/defaults/main.yml | 1 + roles/dhcpcd/templates/dhcpcd.conf.j2 | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/roles/dhcpcd/defaults/main.yml b/roles/dhcpcd/defaults/main.yml index a6264b6..7f5b223 100644 --- a/roles/dhcpcd/defaults/main.yml +++ b/roles/dhcpcd/defaults/main.yml @@ -11,3 +11,4 @@ dhcpcd_noipv4ll: false dhcpcd_noipv4: false dhcpcd_noipv6rs: false dhcpcd_interfaces: [] +dhcpcd_nodev: false diff --git a/roles/dhcpcd/templates/dhcpcd.conf.j2 b/roles/dhcpcd/templates/dhcpcd.conf.j2 index ee26d45..c31497b 100644 --- a/roles/dhcpcd/templates/dhcpcd.conf.j2 +++ b/roles/dhcpcd/templates/dhcpcd.conf.j2 @@ -1,5 +1,10 @@ # A sample configuration for dhcpcd. # See dhcpcd.conf(5) for details. +{% if dhcpcd_nodev %} + +# Disable device management to avoid "libudev: received NULL device" log spam +nodev +{% endif %} # Allow users of this group to interact with dhcpcd via the control socket. {% if dhcpcd_controlgroup is defined %}