|
Harald Hoyer |
a66b47 |
From a43f97c4e35d0d9c7e6e315e11c909e86936e1cc Mon Sep 17 00:00:00 2001
|
|
Harald Hoyer |
a66b47 |
From: Harald Hoyer <harald@redhat.com>
|
|
Harald Hoyer |
a66b47 |
Date: Tue, 17 Jul 2012 11:06:25 +0200
|
|
Harald Hoyer |
a66b47 |
Subject: [PATCH] systemd/dracut-pre-pivot.service: force clean stop of udevd
|
|
Harald Hoyer |
a66b47 |
and cleanup-db
|
|
Harald Hoyer |
a66b47 |
|
|
Harald Hoyer |
a66b47 |
---
|
|
Harald Hoyer |
a66b47 |
modules.d/98systemd/dracut-pre-pivot.service | 2 +-
|
|
Harald Hoyer |
a66b47 |
modules.d/98systemd/dracut-pre-pivot.sh | 3 +++
|
|
Harald Hoyer |
a66b47 |
modules.d/98systemd/module-setup.sh | 4 ----
|
|
Harald Hoyer |
a66b47 |
modules.d/98systemd/udevadm-cleanup-db.service | 20 --------------------
|
|
Harald Hoyer |
a66b47 |
4 files changed, 4 insertions(+), 25 deletions(-)
|
|
Harald Hoyer |
a66b47 |
delete mode 100644 modules.d/98systemd/udevadm-cleanup-db.service
|
|
Harald Hoyer |
a66b47 |
|
|
Harald Hoyer |
a66b47 |
diff --git a/modules.d/98systemd/dracut-pre-pivot.service b/modules.d/98systemd/dracut-pre-pivot.service
|
|
Harald Hoyer |
a66b47 |
index 61257cf..317b476 100644
|
|
Harald Hoyer |
a66b47 |
--- a/modules.d/98systemd/dracut-pre-pivot.service
|
|
Harald Hoyer |
a66b47 |
+++ b/modules.d/98systemd/dracut-pre-pivot.service
|
|
Harald Hoyer |
a66b47 |
@@ -16,7 +16,7 @@ ConditionPathExists=/etc/initrd-release
|
|
Harald Hoyer |
a66b47 |
[Service]
|
|
Harald Hoyer |
a66b47 |
Type=oneshot
|
|
Harald Hoyer |
a66b47 |
ExecStart=-/bin/dracut-pre-pivot
|
|
Harald Hoyer |
a66b47 |
-ExecStopPost=-/usr/bin/systemctl isolate initrd-switch-root.target
|
|
Harald Hoyer |
a66b47 |
+ExecStopPost=-/usr/bin/systemctl --no-block isolate initrd-switch-root.target
|
|
Harald Hoyer |
a66b47 |
StandardInput=null
|
|
Harald Hoyer |
a66b47 |
StandardOutput=syslog
|
|
Harald Hoyer |
a66b47 |
StandardError=syslog+console
|
|
Harald Hoyer |
a66b47 |
diff --git a/modules.d/98systemd/dracut-pre-pivot.sh b/modules.d/98systemd/dracut-pre-pivot.sh
|
|
Harald Hoyer |
a66b47 |
index 31dded5..44afe54 100755
|
|
Harald Hoyer |
a66b47 |
--- a/modules.d/98systemd/dracut-pre-pivot.sh
|
|
Harald Hoyer |
a66b47 |
+++ b/modules.d/98systemd/dracut-pre-pivot.sh
|
|
Harald Hoyer |
a66b47 |
@@ -39,4 +39,7 @@ echo "NEWROOT=\"$NEWROOT\"" >> /run/initramfs/switch-root.conf
|
|
Harald Hoyer |
a66b47 |
|
|
Harald Hoyer |
a66b47 |
getarg rd.break rdbreak && emergency_shell -n switch_root "Break before switch_root"
|
|
Harald Hoyer |
a66b47 |
|
|
Harald Hoyer |
a66b47 |
+/usr/bin/udevadm control --exit || warn "/usr/bin/udevadm control --exit failed"
|
|
Harald Hoyer |
a66b47 |
+/usr/bin/udevadm info --cleanup-db || warn "/usr/bin/udevadm info --cleanup-db failed"
|
|
Harald Hoyer |
a66b47 |
+
|
|
Harald Hoyer |
a66b47 |
exit 0
|
|
Harald Hoyer |
a66b47 |
diff --git a/modules.d/98systemd/module-setup.sh b/modules.d/98systemd/module-setup.sh
|
|
Harald Hoyer |
a66b47 |
index 5cb236c..05faf87 100755
|
|
Harald Hoyer |
a66b47 |
--- a/modules.d/98systemd/module-setup.sh
|
|
Harald Hoyer |
a66b47 |
+++ b/modules.d/98systemd/module-setup.sh
|
|
Harald Hoyer |
a66b47 |
@@ -143,10 +143,6 @@ install() {
|
|
Harald Hoyer |
a66b47 |
inst_simple "$moddir/dracut-pre-pivot.service" ${dracutsystemunitdir}/dracut-pre-pivot.service
|
|
Harald Hoyer |
a66b47 |
ln -fs ../dracut-pre-pivot.service "${initdir}${dracutsystemunitdir}/basic.target.wants/dracut-pre-pivot.service"
|
|
Harald Hoyer |
a66b47 |
|
|
Harald Hoyer |
a66b47 |
- inst_simple "$moddir/udevadm-cleanup-db.service" ${dracutsystemunitdir}/udevadm-cleanup-db.service
|
|
Harald Hoyer |
a66b47 |
- mkdir -p "${initdir}${dracutsystemunitdir}/initrd-switch-root.target.requires"
|
|
Harald Hoyer |
a66b47 |
- ln -fs ../udevadm-cleanup-db.service "${initdir}${dracutsystemunitdir}/initrd-switch-root.target.requires/udevadm-cleanup-db.service"
|
|
Harald Hoyer |
a66b47 |
-
|
|
Harald Hoyer |
a66b47 |
inst_script "$moddir/service-to-run.sh" "${systemdutildir}/system-generators/service-to-run"
|
|
Harald Hoyer |
a66b47 |
}
|
|
Harald Hoyer |
a66b47 |
|
|
Harald Hoyer |
a66b47 |
diff --git a/modules.d/98systemd/udevadm-cleanup-db.service b/modules.d/98systemd/udevadm-cleanup-db.service
|
|
Harald Hoyer |
a66b47 |
deleted file mode 100644
|
|
Harald Hoyer |
a66b47 |
index 368a0dd..0000000
|
|
Harald Hoyer |
a66b47 |
--- a/modules.d/98systemd/udevadm-cleanup-db.service
|
|
Harald Hoyer |
a66b47 |
+++ /dev/null
|
|
Harald Hoyer |
a66b47 |
@@ -1,20 +0,0 @@
|
|
Harald Hoyer |
a66b47 |
-# This file is part of systemd.
|
|
Harald Hoyer |
a66b47 |
-#
|
|
Harald Hoyer |
a66b47 |
-# systemd is free software; you can redistribute it and/or modify it
|
|
Harald Hoyer |
a66b47 |
-# under the terms of the GNU Lesser General Public License as published by
|
|
Harald Hoyer |
a66b47 |
-# the Free Software Foundation; either version 2.1 of the License, or
|
|
Harald Hoyer |
a66b47 |
-# (at your option) any later version.
|
|
Harald Hoyer |
a66b47 |
-
|
|
Harald Hoyer |
a66b47 |
-[Unit]
|
|
Harald Hoyer |
a66b47 |
-Description=Cleanup udevd DB
|
|
Harald Hoyer |
a66b47 |
-DefaultDependencies=no
|
|
Harald Hoyer |
a66b47 |
-ConditionPathExists=/etc/initrd-release
|
|
Harald Hoyer |
a66b47 |
-Conflicts=systemd-udevd.service systemd-udevd-control.socket systemd-udevd-kernel.socket
|
|
Harald Hoyer |
a66b47 |
-Before=initrd-switch-root.service
|
|
Harald Hoyer |
a66b47 |
-
|
|
Harald Hoyer |
a66b47 |
-[Service]
|
|
Harald Hoyer |
a66b47 |
-Type=oneshot
|
|
Harald Hoyer |
a66b47 |
-ExecStart=-/usr/bin/udevadm info --cleanup-db
|
|
Harald Hoyer |
a66b47 |
-StandardInput=null
|
|
Harald Hoyer |
a66b47 |
-StandardOutput=null
|
|
Harald Hoyer |
a66b47 |
-StandardError=null
|