FS#74534 - [mkinitcpio] shutdown hook copy

Attached to Project: Arch Linux
Opened by Simon Perry (pezz) - Friday, 22 April 2022, 04:25 GMT
Last edited by Toolybird (Toolybird) - Thursday, 01 December 2022, 19:47 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Giancarlo Razzolini (grazzolini)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 14
Private No

Details

Description:

Not sure what has changed to trigger this, but it seems the shutdown hook is running before tmpfiles has created /run/initramfs and there's an error with the cp command.

Additional info:
* package version(s): mkinitcpio 31-2

Steps to reproduce:

I added some echo commands to see what was doing this, and it appears to be the cp in /usr/lib/initcpio/hooks/shutdown:

run_cleanuphook() {
echo "run_cleanuphook"
rm -rf /usr/lib/modules
cp -ax / /run/initramfs
echo "end run_cleanuphook"
}

On the console during boot:

run_cleanuphook
cp: cannot create directory '/run/initramfs/': No such file or directory
end run_cleanuphook

Advice or a fix appreciated.

Cheers.
This task depends upon

Closed by  Toolybird (Toolybird)
Thursday, 01 December 2022, 19:47 GMT
Reason for closing:  Fixed
Additional comments about closing:  See comments
Comment by nl6720 (nl6720) - Tuesday, 25 October 2022, 14:33 GMT
The shutdown hook has been obsolete for almost a decade. https://lists.archlinux.org/archives/list/arch-dev-public%40lists.archlinux.org/thread/3RK7CTPX3ABBSBWLR5LO62DIGBMNVYOX/#3RK7CTPX3ABBSBWLR5LO62DIGBMNVYOX

Is there any reason why you are still using it?

Comment by Michel Koss (MichelKoss1) - Monday, 14 November 2022, 21:18 GMT
One of the reasons was posted in https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio/-/issues/104#note_80414

Beside that it doesn't make sense to ship broken hook. Either fix or remove it.

BTW: This ticket has more votes than any other open mkinitcpio bug (only few tickets had more in project history) so perhaps people see some value in this hook.
Comment by nl6720 (nl6720) - Sunday, 27 November 2022, 13:34 GMT Comment by Simon Perry (pezz) - Thursday, 01 December 2022, 08:23 GMT
Apologies for the delay, confirm that /. fixes this.

Loading...