Description of problem: /sbin/halt.pre failed to run upon shutdown/reboot For halt/reboot background information: grep /sbin/halt.pre /etc/init.d/* Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. click up a terminal 2. su - root 3. save attached shutdown_test.sh 4. chmod +x shutdown_test.sh 5. shutdown_test.sh 6. reboot 7. shutdown_test.sh 8. shutdown_test.sh -i 9. shutdown -h now 10. Power up system 11. shutdown_test.sh Remove regression scripts and results with shutdown_test.sh -c Possible patch found here. https://bzattachment.mandriva.com/attachment.cgi?id=18592
Created attachment 1239 [details] shutdown_test.sh regression test
Blocks: (none) => 2120
(In reply to comment #0) > Possible patch found here. > https://bzattachment.mandriva.com/attachment.cgi?id=18592 i don't think because it wants to use /sbin/halt.pre which doesn't exist so i think the fix is something else.
CC: (none) => dmorganec
does it works better after installing systemd-sysvinit ?
(In reply to comment #2) > (In reply to comment #0) > > Possible patch found here. > > https://bzattachment.mandriva.com/attachment.cgi?id=18592 > > i don't think because it wants to use /sbin/halt.pre which doesn't exist Very true. But, it will exist if the system admin wants it to exist. > so i think the fix is something else. How sad. :-( /sbin/halt.pre is just like /etc/dhclient-exit-hooks and /sbin/halt.local. They are files created by the system admin to do whatever is desired when triggered by the events which execute them. In this case reboot, shutdown, halt. Pull the patch from the indicated link, change Mandriva to Mageia, apply it, run the the regression test script. If works, push into the release cycle. That will make any system admin who use/need that feature very happy. :)
(In reply to comment #3) > does it works better after installing systemd-sysvinit ? @ Bit Twister, Can you please reply to D Morgan's question?
Keywords: (none) => NEEDINFOCC: (none) => marja11
(In reply to comment 5) Running the attached regression test script shows it still failing. :( # shutdown_test.sh /root/regression_test_results/shutdown_test_2_Cauldron_x86_64.rpt from /local/bin/shutdown_test.sh Tue Jan 31 15:21:43 CST 2012 /sbin/halt.pre failed to run upon shutdown/reboot We know this because /root/regression_test_results/halt.pre was not created by /sbin/halt.pre during shutdown or reboot /sbin/halt.local test passed Run /local/bin/shutdown_test.sh -c to remove /sbin/halt.(pre, local) and test results
Keywords: NEEDINFO => (none)
what about this bug with systemd 40 ?
(In reply to comment #7) > what about this bug with systemd 40 ? run the attached regression test, reboot, run test again and see. Hopefully I can test with Beta1.
(In reply to comment #7) > what about this bug with systemd 40 ? Still broke in systemd-43-1
Source RPM: systemd-37-14.mga2.src.rpm => systemd-43-1.mga2.src.rpm
(In reply to comment #9) > (In reply to comment #7) > > what about this bug with systemd 40 ? > > Still broke in systemd-43-1 assigning
Assignee: bugsquad => dmorganec
The previous halt.pre was run after all processes were killed but before unmounting. There is no such hook position in systemd to achieve this level of injection of commands. The Mandriva patch just copies the halt-local.service file already provided and thus will run halt.pre at a different point in time, so it's an invalid fix and one I'd rather not entertain. That said there is little need to put jobs here specifically. Rather than patch systemd we should just advise users to write their own unit to do what they need. I've added such a note to the errata; https://wiki.mageia.org/en/Mageia_2_Errata#Deprecated_Functionality This may eventually be moved to the release notes or a more appropriate place, but at least it is noted for now. I think this is better than providing another "standard" unit that does the same thing as one already provided. Users upgrading should be aware of the change from reading release notes/errata, especially if they are the kind of user to create and use a custom halt.pre script.
CC: (none) => mageiaResolution: (none) => WONTFIXStatus: NEW => RESOLVED