Can not execute: /sbin/reboot [solved]

You can report problems, make suggestions, about the new BETA versions in this forum. For stuff related to final releases, please post a message in other forums
Post Reply
eworm
Posts: 27
Joined: 29 Jan 2008, 08:21
Location: Oberhausen
Contact:

Can not execute: /sbin/reboot [solved]

Post by eworm » 20 Aug 2010, 09:48

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

eworm
Posts: 27
Joined: 29 Jan 2008, 08:21
Location: Oberhausen
Contact:

Re: Can not execute: /sbin/reboot

Post by eworm » 23 Aug 2010, 07:54

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

emiliano
Posts: 22
Joined: 22 Nov 2010, 19:14
Location: Italy

Re: Can not execute: /sbin/reboot

Post by emiliano » 04 Mar 2011, 12:08

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

gernot
Posts: 1131
Joined: 07 Apr 2010, 16:19

Re: Can not execute: /sbin/reboot

Post by gernot » 04 Mar 2011, 16:16

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

emiliano
Posts: 22
Joined: 22 Nov 2010, 19:14
Location: Italy

Re: Can not execute: /sbin/reboot

Post by emiliano » 04 Mar 2011, 20:23

you're right Gernot :-)

Tenzer
Posts: 3
Joined: 18 Mar 2010, 16:02

Re: Can not execute: /sbin/reboot

Post by Tenzer » 13 Oct 2011, 12:30

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?

Tenzer
Posts: 3
Joined: 18 Mar 2010, 16:02

Re: Can not execute: /sbin/reboot

Post by Tenzer » 16 Jan 2012, 13:28

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

admin
Site Admin
Posts: 2715
Joined: 17 Jul 2003, 09:44

Re: Can not execute: /sbin/reboot

Post by admin » 26 Jun 2012, 05:56

Thanks this patch has been merged in sysresccd-2.8.1-beta003.

gernot
Posts: 1131
Joined: 07 Apr 2010, 16:19

Re: Can not execute: /sbin/reboot

Post by gernot » 26 Jun 2012, 19:26

The patch in beta3 work.
Now i can reboot or halt a system running via NBD without problems.

Thanks
Gernot

Post Reply