# reboot command not really rebooting...

## brain salad surgery

can somenone tell me why on my compaq armada m700

with kernel 2.6.11-gentoo-r6, when i type reboot,

the system is not really rebooting nor halting...

it hangs somewhere after having closed the services

and i have to power it off and on manually 

i'd really like to make a router of it and to be able to reboot

it remotely

thanks

----------

## pem

You have to set APM or ACPI under your kernel's config. They manage the halt/reboot.

----------

## brain salad surgery

of course, i have set acpi directly in the kernel that i uses successfully 

for the sleep state and all, with acpid running.  Maybe is it

acpid that has to be set properly ?

here are the relevant parts from my kernel config:

#

# Power management options (ACPI, APM)

#

CONFIG_PM=y

CONFIG_PM_DEBUG=y

CONFIG_SOFTWARE_SUSPEND=y

CONFIG_PM_STD_PARTITION=""

#

# ACPI (Advanced Configuration and Power Interface) Support

#

CONFIG_ACPI=y

CONFIG_ACPI_BOOT=y

CONFIG_ACPI_INTERPRETER=y

CONFIG_ACPI_SLEEP=y

CONFIG_ACPI_SLEEP_PROC_FS=y

CONFIG_ACPI_AC=y

CONFIG_ACPI_BATTERY=y

CONFIG_ACPI_BUTTON=y

CONFIG_ACPI_VIDEO=y

CONFIG_ACPI_FAN=y

CONFIG_ACPI_PROCESSOR=y

CONFIG_ACPI_THERMAL=y

# CONFIG_ACPI_ASUS is not set

# CONFIG_ACPI_IBM is not set

# CONFIG_ACPI_TOSHIBA is not set

CONFIG_ACPI_BLACKLIST_YEAR=0

# CONFIG_ACPI_DEBUG is not set

CONFIG_ACPI_BUS=y

CONFIG_ACPI_EC=y

CONFIG_ACPI_POWER=y

CONFIG_ACPI_PCI=y

CONFIG_ACPI_SYSTEM=y

CONFIG_X86_PM_TIMER=y

# CONFIG_ACPI_CONTAINER is not set

#

# APM (Advanced Power Management) BIOS Support

#

# CONFIG_APM is not set

#

# CPU Frequency scaling

#

CONFIG_CPU_FREQ=y

# CONFIG_CPU_FREQ_DEBUG is not set

CONFIG_CPU_FREQ_STAT=y

CONFIG_CPU_FREQ_STAT_DETAILS=y

CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y

# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set

CONFIG_CPU_FREQ_GOV_PERFORMANCE=y

CONFIG_CPU_FREQ_GOV_POWERSAVE=m

CONFIG_CPU_FREQ_GOV_USERSPACE=m

CONFIG_CPU_FREQ_GOV_ONDEMAND=m

CONFIG_CPU_FREQ_TABLE=y

----------

## pem

There are few things that could interfere:

- CONFIG_PM_DEBUG should be unset

- if you set CONFIG_SOFTWARE_SUSPEND, you should provide a partition for it under CONFIG_PM_STD_PARTITION="". Note that it must be around twice the real memory equipped on your box.

The rest seems quite OK.

----------

## pem

 :Idea:  BTW brain salad surgery, the halt or reboot are normally managed by the kernel. The acpid is just a relay. To be sure that your kernel is able to do it without being annoyed by some services messing around a simple program is always welcome:

fast_reboot.c

```
#include <unistd.h>

#include <linux/reboot.h>

void main(void) {

    reboot(LINUX_REBOOT_CMD_RESTART);

}
```

Now compile it with:

```
gcc fast_reboot.c -c fast_reboot
```

Synchronize your file 'caus it's bleeding fast:

```
sync
```

And execute it as root:

```
su -c fast_reboot
```

----------

## brain salad surgery

thanks,

could you explain why fast_reboot this would bypass services shutdown ??

anyway, this did not work any better...

i've recompiled my kernel removing 

- CONFIG_PM_DEBUG

- CONFIG_SOFTWARE_SUSPEND,

now using the reboot command stops

each of the opened services and

i even see the message: 

   Restarting system.

Right after, the screen comes black 

and the damn hard drive led 

stays on 30-60sec, then nothing.

i have to power off and on manually 

Do you think the system has really 

rebooted (right after the restarting

system message) and have 

instead some problems at boot

(before lilo) ?  It's difficult to tell...

I've checked in the

bios but haven't seen anything related

(bios for laptops are quite different

and this is my first one)

----------

## dgaffuri

Had similar problem on a Toshiba Tecra M2 notebook, do you have ipw2200? I had to rmmod it explicitly (after bringing interface down) to make reboot work.

----------

## brain salad surgery

nope, no ipw2200 driver implied here...

----------

## pem

 *brain salad surgery wrote:*   

> could you explain why fast_reboot this would bypass services shutdown ??
> 
> anyway, this did not work any better...

 

This little util call directly the kernel. Thus, it's not bothered by any misconfigured services or things alike. If it works, it means that your kernel is properly configured for your hardware  :Wink: 

 *brain salad surgery wrote:*   

> i've recompiled my kernel removing 
> 
> - CONFIG_PM_DEBUG
> 
> - CONFIG_SOFTWARE_SUSPEND,
> ...

 

All right, from my point of view, I would carry on the way we have started. One other option has been validated under your kernel conf and I don't think it's of any use. Just to be sure, I think you could remove it:

```
CONFIG_ACPI_SLEEP=y

CONFIG_ACPI_SLEEP_PROC_FS=y
```

These are both for ACPI driver developper.

 *brain salad surgery wrote:*   

> Do you think the system has really 
> 
> rebooted (right after the restarting
> 
> system message) and have 
> ...

 

Well, I don't think so. Though, you could give a try to grub just to be sure.

----------

## brain salad surgery

thanks i'll try to remove the acpi options i don't need.

i was wondering if a command such as fast_reboot

is safe for partitions (if they are really unmounted ok

in the process).  If so, i could think of a similar fast_halt

command that i could use on my server (not my laptop).  

It has a big raid 5 partition that i really don't want to loose

(about a teraB).  Anyway, the system is protected

with a tripp-lite ups that won't last more than 

a few minutes (<5min). 

a fast halt command would then be useful to be

sure the system halt even if, say, mldonkey

would make some troubles while stopping and

hang...  Just want to be sure it is safe

for my partition md0

for a halt, what would be the fast_halt.c i 

would need ?

i'll recompile my laptop's kernel...

thanks a lot guys,

----------

## brain salad surgery

just to be sure:  the fast_reboot program didn't work 

and without

CONFIG_ACPI_SLEEP

CONFIG_ACPI_SLEEP_PROC_FS

the kernel doesn't do any better

would like to know why...

a bios issue ?  anyone's got a compaq armada m700 ?

----------

## dgaffuri

Have you tried to play with reboot= kernel parameter? I don't remember exactly the allowed values now.

----------

## pem

 *brain salad surgery wrote:*   

> i was wondering if a command such as fast_reboot
> 
> is safe for partitions (if they are really unmounted ok
> 
> in the process).

 

It's not safe caus' data are not sync on drive. Everything in the cache is lost or journalled. Thus I do not recommend it for a server...

 *brain salad surgery wrote:*   

> for a halt, what would be the fast_halt.c i 
> 
> would need ?

 

There are 2 choices. Just replace LINUX_REBOOT_CMD_RESTART by:

LINUX_REBOOT_CMD_HALT or LINUX_REBOOT_CMD_POWER_OFF

You can have a look at the man page for some details:

```
man 2 reboot
```

 *brain salad surgery wrote:*   

> would like to know why...
> 
> a bios issue ? anyone's got a compaq armada m700 ?

 

Probably a BIOS issue... And dgaffuri comes with a good idea. The reboot method can be tuned on the kernel line. According to /usr/src/linux/arch/i386/kernel/reboot.c Just add that to your kernel line:

warm" reboot (no memory testing etc)

```
reboot=w
```

cold reboot (with memory testing etc)

```
reboot=c
```

bios reboot by jumping through the BIOS: This could better handle a BIOS issue

```
reboot=b
```

hard reboot by toggling RESET and/or crashing the CPU

```
reboot=c
```

----------

## DiD@SyN

try using ACPI OR APM. In your case, I would say disable all APM options in your kernel. If you really need APM support try disabling all ACPI options.

Give it a try.

----------

## brain salad surgery

thanks a lot guys, i'm happy to have that

much suggestions

only acpi is set, and i did give a try to apm without success 

(and moreover sleeping state wasn't well supported, so

i switched back to acpi)

i'm pretty sure now that the system has really shut down

using the reboot command and is having trouble booting  

because i hear the cdrom make a little sound

i trying all of the reboot kernel parameter using

a line like:

        append="reboot=h"

but none of them changed anything...

the system still hangs on a black screen before 

lilo and before i can read "COMPAQ" like in a

usual boot process

----------

## brain salad surgery

i tried recently a live cd (WHAX) that was able to 

reboot the laptop, no problema !

but the fast_reboot script is not able.

someone has an idea ? Another kernel option

that conflicts ?

----------

## pem

You could check if this livecd relies on APM instead of ACPI. May be your laptop is not compatible with ACPI. That would explain a lot. If this is the case, you will have to remove everything concerning ACPI and validate every options for APM.

----------

