Hello. The reason was revealed on VirtualBox 5.2.6 Steps to Reproduce: 1. Put them in the beginning of the file /usr/lib/dracut/modules.d/99shutdown/shutdown.sh echo "SHUTDOWN RUNNING!" echo "PRESS ENTER..." read a 2. dracut -f 3. touch /run/initramfs/.need_shutdown; shutdown -H now Mageia-5, for example kernel 4.4.111-1.mga5, dracut 038 (screenshot 4.4.111-1.mga5-dracut-038) Works great! Mageia-6, for example kernel 4.14.13-desktop-1.mga6, dracut 044 (screenshot 4.14.13-desktop-1.mga6-dracut-044) Does not start /run/initramfs/shutdown I'm Doing a live usb stick with persistence, otherwise I would not have paid attention to this fact (screenshot print_req_error-kernel-4.14.13-Mageia6). My method definition is too simple or wrong? Thank you...
Created attachment 9938 [details] screenshot
Created attachment 9939 [details] 4.4.111-1.mga5-dracut-038
Created attachment 9940 [details] 4.14.13-desktop-1.mga6-dracut-044
Created attachment 9941 [details] print_req_error-kernel-4.14.13-Mageia6
CC: (none) => marja11, ngompa13Source RPM: (none) => systemdAssignee: bugsquad => basesystem
The reason is that from dracut 042 onwards, /run gets mounted with the noexec option. systemd-shutdown only pivots back to the initramfs if /run/initramfs/shutdown exists and is executable. I have opened an issue about this upstream (https://github.com/dracutdevs/dracut/issues/481). You can work around this by creating a script in /usr/lib/systemd/system-shutdown with the following contents: #!/bin/sh mount -o remount,exec /run
CC: (none) => mageia
Thank you, Martin.
(In reply to Martin Whitaker from comment #5) > The reason is that from dracut 042 onwards, /run gets mounted with the > noexec option. systemd-shutdown only pivots back to the initramfs if > /run/initramfs/shutdown exists and is executable. > > I have opened an issue about this upstream > (https://github.com/dracutdevs/dracut/issues/481). > > You can work around this by creating a script in > /usr/lib/systemd/system-shutdown with the following contents: > > #!/bin/sh > mount -o remount,exec /run Hello, Martin. I am very grateful to You for dealing with this problem. I am writing to inform You about current results on this issue. Currently using Mageia-7-beta2 (Kernel v5.0.7-2, systemd v241, dracut v042). Now remounting the flash drive and unmounting partitions is successful, as e2fsck says-that is no mistakes, it's all clear. However, I use "mount -o remount,exec /run" in the file "/usr/lib/dracut/modules.d/90mgalive/mgalive-shutdown.sh". I don't know how this is correct, but works for me That's the way. I noticed that in Mageia-7-beta2 "/usr/lib/dracut/modules.d/90mgalive/mgalive-root.sh" modification which I use to make my initrd for saving flash drives. In the new version of this script state the specific command unmounting distrib, overlay, media, earlier this nebylo. I only have add my "save.img" and everything worked. I have a questions: will the current situation and reliable unmounting in the future? Should I close this issue or is it still in the process of being resolved? Thanks. Separately thank for subject https://github.com/dracutdevs/dracut/issues/481 I would very much like to join You in discussing this issue, but I feel that this topic is difficult for me and I will only interfere there. :( With respect, Alex p.s. Sorry for the online English translation...
As I was warned in the upstream bug report, my original fix stopped working with the update to systemd 241. So instead I have added the remount command to /usr/lib/dracut/dracut-initramfs-restore. So if you have dracut-046-11.mga7 installed, you should not need to add your own remount command. This works fine on the forthcoming beta3 Live ISOs. Please could you test that it also works for you.
Hello, Martin. In the previous post, I made a typo because it was dracut v046-11, not 042, sorry. For testing and as a visual confirmation, I collected a completely fresh Assembly for the flash drive. The system language is English, archive size 1,3GB: https://drive.google.com/open?id=1t1_oxC6hwCOkCQxyZXFavwefVAO4KxNl I confirm, with Your last changes everything works perfectly. The bug was really complicated. Thank You for your help and decision. With respect, Alex
Resolution: (none) => FIXEDStatus: NEW => RESOLVED
commit 1ed60d25874839c7cc477210754ffd752c2cd797 Author: Thomas Backlund <tmb@...> Date: Sat Oct 19 19:27:20 2013 +0100 Updated to eject CD and pause on shutdown. Signed-off-by: Martin Whitaker <mageia@martin-whitaker.me.uk> - origin: https://svnweb.mageia.org/packages/cauldron/dracut/current/SOURCES/0511-mgalive-A-module-to-mount-Mageia-Live-media.patch?r1=1231609&r2=1326566 - enable pivot back to dracut on shutdown (mga#22516) o see also upstream issue #481 - fix shutdown umount retry loop (upstream issue #483) - mgalive: ensure overlay filesystems are cleanly unmounted on shutdown - mgalive: eject optical media and pause on shutdown --- Commit Link: https://gitweb.mageia.org/software/mageia-dracut-conf/commit/?id=1ed60d25874839c7cc477210754ffd752c2cd797