[arch-projects] Issue about shutdown hook in mkinitcpio/initscripts (/run is noexec)
Hello, I am testing this for archiso (I think will help me for dm-snapshot persistent). I am writing custom shutdown hooks that fit for archiso. Anyway, /run is mounted as noexec. This should be changed ;) :: Creating shutdown ramfs...chroot: can't execute '/bin/busybox': Permission denied all rest of things will fail ;) http://mailman.archlinux.org/pipermail/arch-projects/2011-July/001549.html -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On 08/24/2011 12:35 AM, Gerardo Exequiel Pozzi wrote:
Hello,
I am testing this for archiso (I think will help me for dm-snapshot persistent). I am writing custom shutdown hooks that fit for archiso. Anyway, /run is mounted as noexec. This should be changed ;)
:: Creating shutdown ramfs...chroot: can't execute '/bin/busybox': Permission denied
all rest of things will fail ;)
http://mailman.archlinux.org/pipermail/arch-projects/2011-July/001549.html
Another thing (added set -x before if) :: Unmounting Filesystems [DONE] + [[ -x /run/initramfs/shutdown ]] + mount --bind /run/initramfs /run/initramfs + mount --make-private /run/initramfs mount: can't find /run/initramfs in /etc/fstab or /etc/mtab + mount --make-private / -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
On Wed, Aug 24, 2011 at 12:35:50AM -0300, Gerardo Exequiel Pozzi wrote:
Hello,
I am testing this for archiso (I think will help me for dm-snapshot persistent). I am writing custom shutdown hooks that fit for archiso. Anyway, /run is mounted as noexec. This should be changed ;)
:: Creating shutdown ramfs...chroot: can't execute '/bin/busybox': Permission denied
all rest of things will fail ;)
http://mailman.archlinux.org/pipermail/arch-projects/2011-July/001549.html
-- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
mkinitcpio: https://github.com/falconindy/mkinitcpio/commit/a97f2a7865b2b743b9049a6fe initscripts: http://projects.archlinux.org/initscripts.git/commit/?id=a79921851bfd93b3 d
On 08/24/2011 12:35 AM, Gerardo Exequiel Pozzi wrote:
Hello,
I am testing this for archiso (I think will help me for dm-snapshot persistent). I am writing custom shutdown hooks that fit for archiso. Anyway, /run is mounted as noexec. This should be changed ;)
:: Creating shutdown ramfs...chroot: can't execute '/bin/busybox': Permission denied
all rest of things will fail ;)
http://mailman.archlinux.org/pipermail/arch-projects/2011-July/001549.html
Another thing is the last code about halt/poweroff/reboot. # reboot / poweroff / halt, depending on the argument passed by init # if something invalid is passed, we halt case "$1" in reboot|poweroff|halt) "$1" -f ;; *) halt -f;; esac $1 is undefined here, so always go to halt -f. why not take decision from $RUNLEVEL?, this variable is defined at this stage. like in rc.shutdown: if [[ $RUNLEVEL == 0 ]]; then poweroff -f else reboot -f fi And we need to use poweroff and not halt, it just stop the system without calling acpi_poweroff(). -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Hi Gerardo, On Thu, Aug 25, 2011 at 7:37 AM, Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> wrote:
Another thing is the last code about halt/poweroff/reboot.
# reboot / poweroff / halt, depending on the argument passed by init # if something invalid is passed, we halt case "$1" in reboot|poweroff|halt) "$1" -f ;; *) halt -f;; esac
$1 is undefined here, so always go to halt -f. why not take decision from $RUNLEVEL?, this variable is defined at this stage.
Ah, you are ahead of me ;-) I have a patch against initscripts that passes the correct value, but I have not been able to test it properly yet so have not pushed it. I'll do it today.
like in rc.shutdown:
if [[ $RUNLEVEL == 0 ]]; then poweroff -f else reboot -f fi
The only reason it's done with $1 rather than $RUNLEVEL is that I wanted to implement the same interface as systemd/dracut. I guess we could have fallen back to checking $RUNLEVEL, but (once my patch to initscripts is in) having $1 not defined means that something is very wrong, so I thought halting was a nice way to show that. /me starts testing some patches ;-) Cheers, Tom
participants (3)
-
Dave Reisner
-
Gerardo Exequiel Pozzi
-
Tom Gundersen