Bug 3744 - 2_a1: /sbin/halt.pre failed to run upon shutdown/reboot
Summary: 2_a1: /sbin/halt.pre failed to run upon shutdown/reboot
Status: RESOLVED WONTFIX
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: D Morgan
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 2120
  Show dependency treegraph
 
Reported: 2011-12-14 17:19 CET by Bit Twister
Modified: 2012-04-09 17:43 CEST (History)
3 users (show)

See Also:
Source RPM: systemd-43-1.mga2.src.rpm
CVE:
Status comment:


Attachments
shutdown_test.sh regression test (3.69 KB, text/plain)
2011-12-14 17:20 CET, Bit Twister
Details

Description Bit Twister 2011-12-14 17:19:25 CET
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
Comment 1 Bit Twister 2011-12-14 17:20:56 CET
Created attachment 1239 [details]
shutdown_test.sh regression test
Manuel Hiebel 2011-12-14 20:14:01 CET

Blocks: (none) => 2120

Comment 2 D Morgan 2011-12-16 08:05:37 CET
(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

Comment 3 D Morgan 2011-12-16 08:09:11 CET
does it works better after installing systemd-sysvinit ?
Comment 4 Bit Twister 2011-12-16 13:40:58 CET
(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. :)
Comment 5 Marja Van Waes 2012-01-31 21:25:46 CET
(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) => NEEDINFO
CC: (none) => marja11

Comment 6 Bit Twister 2012-01-31 22:33:16 CET
(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)

Comment 7 D Morgan 2012-02-11 03:35:53 CET
what about this bug with systemd 40 ?
Comment 8 Bit Twister 2012-02-11 04:18:45 CET
(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.
Comment 9 Bit Twister 2012-02-28 09:03:38 CET
(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

Comment 10 Marja Van Waes 2012-02-28 17:03:39 CET
(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

Comment 11 Colin Guthrie 2012-04-09 17:43:07 CEST
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) => mageia
Resolution: (none) => WONTFIX
Status: NEW => RESOLVED


Note You need to log in before you can comment on or make changes to this bug.