nixos: completely remove systemd-udev-settle.service (#504510)

This commit is contained in:
Will Fancher
2026-04-09 19:33:37 +00:00
committed by GitHub
8 changed files with 17 additions and 20 deletions
@@ -320,7 +320,6 @@
systemd.services.nvidia-container-toolkit-cdi-generator = {
description = "Container Device Interface (CDI) for Nvidia generator";
after = [ "systemd-udev-settle.service" ];
requiredBy = lib.mkMerge [
(lib.mkIf config.virtualisation.docker.enable [ "docker.service" ])
(lib.mkIf config.virtualisation.podman.enable [ "podman.service" ])
@@ -329,6 +328,11 @@
serviceConfig = {
RuntimeDirectory = "cdi";
RemainAfterExit = true;
# We wait for the udev events queue to empty in the *hope* that the
# devices needed here become available. This is terribly broken and
# essentially no better than a random sleep(). See PR #452645 for
# an attempt to fix this issue.
ExecStartPre = "-${lib.getExe' pkgs.systemd "udevadm"} settle --timeout=180";
ExecStart =
let
script = pkgs.callPackage ./cdi-generate.nix {
-1
View File
@@ -455,7 +455,6 @@ in
"systemd-udevd-control.socket"
"systemd-udevd-kernel.socket"
"systemd-udevd.service"
"systemd-udev-settle.service"
"systemd-udev-trigger.service"
];
boot.initrd.systemd.storePaths = [
@@ -69,7 +69,6 @@ let
# https://github.com/systemd/systemd/blob/main/units/systemd-networkd.service.in
commonServiceConfig = {
after = [
"systemd-udev-settle.service"
"network-pre.target"
"systemd-sysusers.service"
"systemd-sysctl.service"
@@ -88,6 +87,12 @@ let
"network.target"
];
# We wait for the udev events queue to empty in the *hope* that the
# devices needed here become available. This is terribly broken and
# essentially no better than a random sleep().
# FIXME: use .device units dependecies instead.
serviceConfig.ExecStartPre = "-${lib.getExe' pkgs.systemd "udevadm"} settle --timeout=180";
unitConfig = {
# Avoid default dependencies like "basic.target", which prevents ifstate from starting before luks is unlocked.
DefaultDependencies = "no";
@@ -173,7 +178,7 @@ in
etc."ifstate/ifstate.yaml".source = settingsFormat.generate "ifstate.yaml" cfg.settings cfg.package;
};
systemd.services.ifstate = commonServiceConfig // {
systemd.services.ifstate = lib.recursiveUpdate commonServiceConfig {
description = "IfState";
wantedBy = [
@@ -263,7 +268,7 @@ in
"remote-fs.target"
];
services.ifstate-initrd = commonServiceConfig // {
services.ifstate-initrd = lib.recursiveUpdate commonServiceConfig {
description = "IfState initrd";
wantedBy = [
-2
View File
@@ -65,7 +65,6 @@ let
"systemd-udevd-control.socket"
"systemd-udevd-kernel.socket"
"systemd-udevd.service"
"systemd-udev-settle.service"
]
++ (optional (!config.boot.isContainer) "systemd-udev-trigger.service")
++ [
@@ -799,7 +798,6 @@ in
systemd.services.systemd-random-seed.restartIfChanged = false;
systemd.services.systemd-remount-fs.restartIfChanged = false;
systemd.services.systemd-update-utmp.restartIfChanged = false;
systemd.services.systemd-udev-settle.restartIfChanged = false; # Causes long delays in nixos-rebuild
systemd.targets.local-fs.unitConfig.X-StopOnReconfiguration = true;
systemd.targets.remote-fs.unitConfig.X-StopOnReconfiguration = true;
systemd.services.systemd-importd.environment = proxy_env;
+1 -9
View File
@@ -158,16 +158,8 @@ let
}:
lib.nameValuePair "zfs-import-${pool}" {
description = "Import ZFS pool \"${pool}\"";
# We wait for systemd-udev-settle to ensure devices are available,
# but don't *require* it, because mounts shouldn't be killed if it's stopped.
# In the future, hopefully someone will complete this:
# https://github.com/zfsonlinux/zfs/pull/4943
wants = [
"systemd-udev-settle.service"
]
++ lib.optional (config.boot.initrd.clevis.useTang) "network-online.target";
wants = lib.optional (config.boot.initrd.clevis.useTang) "network-online.target";
after = [
"systemd-udev-settle.service"
"systemd-modules-load.service"
"systemd-ask-password-console.service"
]
@@ -67,7 +67,6 @@ in
systemd.services.ovsdb = {
description = "Open_vSwitch Database Server";
wantedBy = [ "multi-user.target" ];
after = [ "systemd-udev-settle.service" ];
path = [ cfg.package ];
restartTriggers = [
db
+1 -2
View File
@@ -106,8 +106,7 @@ in
assert "machine" == machine.succeed("hostname -s").strip()
with subtest("whether systemd-udevd automatically loads modules for our hardware"):
machine.succeed("systemctl start systemd-udev-settle.service")
machine.wait_for_unit("systemd-udev-settle.service")
machine.succeed("udevadm settle --timeout=180")
assert "mousedev" in machine.succeed("lsmod")
with subtest("whether systemd-tmpfiles-clean works"):
+2 -1
View File
@@ -43,9 +43,10 @@ pkgs.lib.listToAttrs (
meta = { };
nodes.machine =
{ lib, ... }:
{ pkgs, lib, ... }:
let
script = ''
${lib.getExe' pkgs.systemd "udevadm"} settle --timeout=180
ip link
if ${lib.optionalString predictable "!"} ip link show eth0; then
echo Success