# Problems with shutdown -h now

## +BroNNoS+

Hi all,

Has anyone else expirienced problems when doing a 'shutdown -h now'? I get the following:

flushing ide devices: hda, hdb etc 

Power Down

/sbin/rc: return : can only 'return' from a function or sourced script

and the computer hangs.

Thanks

----------

## gschneider

I have the same message.

but it doesnt hang, the kernel just doesn't shut the computer off.

You have forgotten to enable APM, ACPI and/or APIC in kernel setup. (I'm not sure which is responsible for it, I think it is ACPI).

So you need to recompile your kernel.

----------

## +BroNNoS+

Thanks, will look into it tonight.  But I'm almost sure I compiled it in already. I already figured out it has to do something with APM, APIC and ACPI stuff. I shall look into the power options more closely.

----------

## Framba

If you find it, can you tell me? I didn't compile nor ACPI nor other Power Management and I would like to keep the kernel as light as I can. Thanks

----------

## Jeevz

Hmm... if I remember correctly you can compile APM/ACPI as a module. If you can, and did, make sure you load it.

----------

## Fragadelic

 *Framba wrote:*   

> If you find it, can you tell me? I didn't compile nor ACPI nor other Power Management and I would like to keep the kernel as light as I can. Thanks

 

If you want it to automatically power off after shutdown, you MUST include ACPI or APM in the kernel, depending on your motherboard capabilities.  Without it there is no way to tell the motherboard to power the system off.

I need to recompile my kernel as it just reboots instead of powering off but it hasn't been a big priority with me.  I might fix it tonight if I get a chance.

----------

## Fragadelic

Okay, I recompiled my kernel tonight and the shutdown to power down works.

If you have an ACPI enabled motherboard you need to include the following in the kernel compile.

I recommend using 'make menuconfig'.

Under the 'General Setup', include the following:

           [*] Power Management support

           [*]   ACPI support

           [ ]     ACPI Debug Statements

          <*>     ACPI Bus Manager

          <*>       System

          < >       Processor

          < >       Button

          < >       AC Adapter

          < >       Embedded Controller

You can check the help on the other options but that is all you need for power off after shutdown.

----------

## sven

My computer also does not power down though I enabled ACPI and APM in my kernel. I get the same script error message after halting the system... This is how my kernel config looks like

[*] Power Management support

[*] ACPI support

[  ] ACPI Debug Statements

<*> ACPI Bus Manager

<*>   System

<*>   Processor

<*>   Button

<  >   AC Adapter

<  >   Embedded Controller

<*> Advanced Power Management BIOS support

[  ]      Ignore USER SUSPEND

[*]      Enable PM at boot time

[*]      Make CPU Idle calls when idle

[  ]      Enable console blanking using APM

[  ]      RTC stores time in GMT

[  ]      Allow interrupts during APM BIOS calls

[*]      Use real mode APM BIOS call to power off

I have an Epox KHAL mainboard...

----------

## Fragadelic

If you have ACPI enabled then you should not have APM enabled.  They will conflict with each other.

Disable the APM stuff and try again.

----------

## sven

Just did it and now it works! Thank you very much!

I just could have fixed the problem myself if I had taken a look into my BIOS setup before! Doh!  :Wink: 

Everybody who experiences the same problem should check if the BIOS supports ACPI or APM and enable/disable these in the kernel. I guess all modern mainboards use ACPI.

----------

## niyogi

cool.. i was having this problem too (although i didn't really regard it so much as a major one

----------

## feend

Hey it's Guybrush Threepwood!  :Smile: 

Anyway. Did the /sbin/rc message ever go away out of

curiosity?

----------

## +BroNNoS+

Got it now:

- Had to recompile the kernel with no SMP support

- Had probs with kernel compilation after this change

- Had to do mrproper (thx fghellar)

- Had some troubles with 'unresolved symbols' with 'make modules'

- Deleted all modules in etc/modules (thx Google), did it again

- After this had problems with sound module, but fixed that also

- All in all compiled the kernel about 20 or more times

- But now it shuts down properly!

Man, do I LOVE Linux  :Smile: )).

----------

## Jeevz

Do you need to get the acpid package to make full use of this?

----------

## Guest

I've enabled all ACPI options, but when I shut down, my optical mouse and NIC don't power off. The NIC stays on-line and the light in my mouse still burns.

Could someone pleaze tell me what's going on?! And how te solve it  :Rolling Eyes: 

Thanx

----------

## pjp

 *Anonymous wrote:*   

> I've enabled all ACPI options, but when I shut down, my optical mouse and NIC don't power off. The NIC stays on-line and the light in my mouse still burns.
> 
> Could someone pleaze tell me what's going on?! And how te solve it 
> 
> Thanx

 

I've heard this (mouse anyway) can be a problem or minor "bug" with some motherboards.  

For the NIC, some have a wake-on-lan setting.  That implies that the NIC won't shut "off".  

Not positive, those are just suggestions.

On a side not, I have a Gigabyte MB with a Slot A Athlon... my optical mouse stays on 

even when I just used Windows..

----------

## knopper

No when I shut down in Windows it all works fine. And I don't use Wake up on LAN (the cable isn't connected) And like I said, in Windows (XP) everthing goes off correctly.

I'm the same user as "guest" but now i'm logged in  :Laughing: 

----------

## lodger

shutdown -h powers off hda but not hdb where I have gentoo

----------

## knopper

 *lodger wrote:*   

> shutdown -h powers off hda but not hdb where I have gentoo

 

Ooh, great  :Rolling Eyes: 

----------

## lain iwakura

I've got a similar problem with the gentoo r1 sources.

I've compiled in ACPI support, bus and system support, and when I use 'shutdown -h now' it goes through the shutdown process and and at the end of the sequence, it just says 'POWERING DOWN" but doesn't.  

anyone know what could be the deal here?

----------

## sibn

 *+BroNNoS+ wrote:*   

> Got it now:
> 
> - Had to recompile the kernel with no SMP support
> 
> - Had probs with kernel compilation after this change
> ...

 

Really?  I always found it easier to open /usr/src/linux/Makefile and change EXTRAVERSION (fourth line) to something else before recompiling.  Helps to avoid problems with modules (etc.), such as the one you had.   :Smile: 

----------

