From fa9797ec9d269f1509725a72c6ea312e37808fb5 Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Mon, 14 Dec 2020 15:10:28 +0800 Subject: [PATCH] dracut-module-setup.sh: Use systemctl call to replace ln_r systemctl -q --root "$initdir" add-wants X.target X.service is the recommanded way to add service dependency, and it covers more corner cases. Signed-off-by: Kairui Song Acked-by: Pingfan Liu --- dracut-module-setup.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index ec1ccc5..21f7105 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -849,8 +849,7 @@ install() { inst "/lib/kdump/kdump-logger.sh" "/lib/kdump-logger.sh" inst "$moddir/kdump.sh" "/usr/bin/kdump.sh" inst "$moddir/kdump-capture.service" "$systemdsystemunitdir/kdump-capture.service" - mkdir -p "$initdir/$systemdsystemunitdir/initrd.target.wants" - ln_r "$systemdsystemunitdir/kdump-capture.service" "$systemdsystemunitdir/initrd.target.wants/kdump-capture.service" + systemctl -q --root "$initdir" add-wants initrd.target kdump-capture.service inst "$moddir/kdump-error-handler.sh" "/usr/bin/kdump-error-handler.sh" inst "$moddir/kdump-error-handler.service" "$systemdsystemunitdir/kdump-error-handler.service" # Replace existing emergency service and emergency target