Page 1 of 1

Can not execute: /sbin/reboot [solved]

Posted: 20 Aug 2010, 09:48
by eworm
Hello everybody,

rebooting a system that was booted via nbd mounted filesystem fails with this error:

Can not execute: /sbin/reboot

I think this is because of /etc/init.d/killprocs killing nbd-cient. I would suggest to add "-o `pidof nbd-client`" to killall5 or to cache /sbin/reboot locally.

Regards,
Chris

Re: Can not execute: /sbin/reboot

Posted: 23 Aug 2010, 07:54
by eworm
I've implemented a simple workaround, created an autorun script:

Code: Select all

#!/bin/sh

cp /sbin/halt /tmp/
mv /tmp/halt /sbin/
ln -sf halt /sbin/reboot
Regards,
Chris

Re: Can not execute: /sbin/reboot

Posted: 04 Mar 2011, 12:08
by emiliano
Hello,
I propose to include the workaround posted by Chris in the following initscript /etc/init.d/cache-halt

Code: Select all

#!/sbin/runscript

depend()
{
    after sysresccd
}

start()
{
    ebegin "Caching /sbin/halt in tmpfs"
    cp /sbin/halt /tmp
    mv /tmp/halt /sbin
    ln -sf halt /sbin/reboot
    eend $?
}

In this way the code can be executed in case of netbooting with the the following kernel boot option:

Code: Select all

initscript=cache-halt:start

Regards,
Emiliano

Re: Can not execute: /sbin/reboot

Posted: 04 Mar 2011, 16:16
by gernot
i would extend /etc/init.d/sysresccd.

Code: Select all

#  ---- allow reboot after dropping the nbd conection ----
if grep -q " netboot=nbd:" /proc/cmdline  
then
    cp /sbin/halt /tmp
    mv /tmp/halt /sbin
    ln -sf /sbin/halt /sbin/reboot
fi

Gernot

Re: Can not execute: /sbin/reboot

Posted: 04 Mar 2011, 20:23
by emiliano
you're right Gernot :-)

Re: Can not execute: /sbin/reboot

Posted: 13 Oct 2011, 12:30
by Tenzer
I can see this still is an issue in 2.3.1, are there any chance of getting something like gernot's work around implemented?

Re: Can not execute: /sbin/reboot

Posted: 16 Jan 2012, 13:28
by Tenzer
Having just corrected this in my own version of Sysresccd, I ended up with a slightly modified version of gernot's work around. This version both works with the 'nbdboot=' and 'netboot=nbd:' style boot parameters.

Code: Select all

# ---- allow reboot after dropping the nbd conection ----
if echo ${CMDLINE} | grep -q ' nbdboot=\| netboot=nbd:'
then
        cp /sbin/halt /tmp
        mv /tmp/halt /sbin
        ln -sf /sbin/halt /sbin/reboot
fi

Re: Can not execute: /sbin/reboot

Posted: 26 Jun 2012, 05:56
by admin
Thanks this patch has been merged in sysresccd-2.8.1-beta003.

Re: Can not execute: /sbin/reboot

Posted: 26 Jun 2012, 19:26
by gernot
The patch in beta3 work.
Now i can reboot or halt a system running via NBD without problems.

Thanks
Gernot