summaryrefslogtreecommitdiff
path: root/units
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2022-08-18 13:15:14 +0000
committerGitHub <noreply@github.com>2022-08-18 13:15:14 +0000
commitcd7ad0cbde507b9b43cf7e1797ce75e98345f4a0 (patch)
tree387b38db43b4acbbb91158a1bc59002e0f91bf66 /units
parent0a152619aca5b6c16d022cc3e6ab2fc3786d0284 (diff)
parentdb5276215ae496074c163fca4014baf1bcd05984 (diff)
downloadsystemd-cd7ad0cbde507b9b43cf7e1797ce75e98345f4a0.tar.gz
Merge pull request #24054 from keszybz/initrd-no-reload
Don't do daemon-reload in the initrd
Diffstat (limited to 'units')
-rw-r--r--units/initrd-parse-etc.service24
-rw-r--r--units/initrd-parse-etc.service.in33
-rw-r--r--units/meson.build2
3 files changed, 34 insertions, 25 deletions
diff --git a/units/initrd-parse-etc.service b/units/initrd-parse-etc.service
deleted file mode 100644
index 38df728355..0000000000
--- a/units/initrd-parse-etc.service
+++ /dev/null
@@ -1,24 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1-or-later
-#
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=Reload Configuration from the Real Root
-DefaultDependencies=no
-Requires=initrd-root-fs.target
-After=initrd-root-fs.target
-OnFailure=emergency.target
-OnFailureJobMode=replace-irreversibly
-AssertPathExists=/etc/initrd-release
-
-[Service]
-Type=oneshot
-ExecStartPre=-systemctl daemon-reload
-# we have to retrigger initrd-fs.target after daemon-reload
-ExecStart=-systemctl --no-block start initrd-fs.target
-ExecStart=systemctl --no-block start initrd-cleanup.service
diff --git a/units/initrd-parse-etc.service.in b/units/initrd-parse-etc.service.in
new file mode 100644
index 0000000000..fe0e860150
--- /dev/null
+++ b/units/initrd-parse-etc.service.in
@@ -0,0 +1,33 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+#
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation; either version 2.1 of the License, or
+# (at your option) any later version.
+
+[Unit]
+Description=Mountpoints Configured in the Real Root
+AssertPathExists=/etc/initrd-release
+
+DefaultDependencies=no
+Requires=initrd-root-fs.target
+After=initrd-root-fs.target
+
+OnFailure=emergency.target
+OnFailureJobMode=replace-irreversibly
+
+[Service]
+Type=oneshot
+
+# FIXME: once dracut is patched to install the symlink, change to:
+# ExecStart={{ROOTLIBEXECDIR}}/systemd-sysroot-fstab-check
+ExecStart=@{{SYSTEM_GENERATOR_DIR}}/systemd-fstab-generator systemd-sysroot-fstab-check
+
+# We want to enqueue initrd-cleanup.service/start after we finished the part
+# above. It can't be part of the initial transaction, because non-oneshot units
+# use Conflicts=initrd-cleanup.service to be terminated before we switch root.
+# Effectively, initrd-parse-etc.service acts as a synchronization point after
+# which cleanup of the initrd processes starts.
+ExecStart=systemctl --no-block start initrd-cleanup.service
diff --git a/units/meson.build b/units/meson.build
index 40f784ec68..2010a5566f 100644
--- a/units/meson.build
+++ b/units/meson.build
@@ -36,7 +36,6 @@ units = [
['suspend-then-hibernate.target', 'ENABLE_HIBERNATE'],
['initrd-cleanup.service', 'ENABLE_INITRD'],
['initrd-fs.target', 'ENABLE_INITRD'],
- ['initrd-parse-etc.service', 'ENABLE_INITRD'],
['initrd-root-device.target', 'ENABLE_INITRD'],
['initrd-root-fs.target', 'ENABLE_INITRD'],
['initrd-switch-root.service', 'ENABLE_INITRD'],
@@ -179,6 +178,7 @@ in_units = [
['emergency.service', ''],
['getty@.service', '',
'autovt@.service'],
+ ['initrd-parse-etc.service', 'ENABLE_INITRD'],
['kmod-static-nodes.service', 'HAVE_KMOD ENABLE_TMPFILES',
'sysinit.target.wants/'],
['quotaon.service', 'ENABLE_QUOTACHECK'],