PC does not turn off when Ubuntu is shut down

Asked by George A

Hello. I'm new to ubuntu, and presently run distro 9.04 as the only OS on my HDD (a “clean install”) . When I shut down ubuntu my PC does not turn off power automatically - the fan and other components remain powered – the screen shows :
[ 2995.588192] System halted

Presently the only way I know to turn off the PC is to press the power button, or to manually operate the power cut-off switch. Previously, when running Windows XP on the same PC, when I shut down XP, the computer would turn off automatically. So it seems that the motherboard has the features for automatic shut down. I would be obliged for suggestions to help fix the automatic shut down problem. Many thanks,

George A

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu yelp Edit question
Assignee:
No assignee Edit question
Solved by:
Sam_
Solved:
Last query:
Last reply:
Revision history for this message
Ian Ace (iaculallad) said :
#1

Does running the command from the terminal:

sudo shutdown -h now

displays the same message on shutdown?

Revision history for this message
George A (gka1999) said :
#2

Hello Ian. In response to terminal command

sudo shutdown -h now

the OS shuts down, and the screen shows:

[152.025198] System halted

The message is the same as before (except for the numbers in the bracket), and the power to the computer did not turn off – it had to be turned off manually. I appreciate your help.

George A

Revision history for this message
Colin Ian King (colin-king) said :
#3

Try the following:

sudo sudo gedit /etc/modprobe.d/apm.conf

and add the following:

apm power_off=1

Then reboot and see if this fixes things.

Revision history for this message
Colin Ian King (colin-king) said :
#4

Ooops, my mistake, it should be:

Try the following:

sudo gedit /etc/modprobe.d/apm.conf

and add the following:

apm power_off=1

Then reboot and see if this fixes things.

Revision history for this message
George A (gka1999) said :
#5

Good day Colin. As noted in my request for help, I'm new to Ubuntu. As per your second suggestion, I ran the command from Terminal, and it brought up gedit :

gka@Asus-old:~$ sudo gedit /etc/modprobe.d/apm.conf
gka@Asus-old:~$

I entered apm power_off=1 in the gedit window and subsequently saved.

The PC was rebooted and then shut down via GUI, however, this did not shut off power to the PC – here is what appeared on screen (monitor) :

[ 1308.907486] System halted

The PC was started and shut down once more, and this did not turn off the power either.

This is the scenario I've been getting since installing Ubuntu 9.04. ( To restore my system to its prior state, I went back to modprobe.d via gedit and deleted my earlier entry). Thank you for trying to help resolve my shut down problem.

George A

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#6

use gksudo with gedit, sudo is for command line commands only.

Try this:

gksudo gedit /etc/default/grub; sudo update-grub

Find this line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

and make it:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash apm=power_off"

Save the new file and close gedit, the system will then update the grub config.

Reboot then test.

Revision history for this message
Best Sam_ (and-sam) said :
#7

Actually apm isn't state of the art. Do you have an older computer?
http://kernelnewbies.org/PowerManagement

Depending which Grub is used different files are related.
Which Grub:
sudo grub-install -v

https://help.ubuntu.com/community/GrubHowto
https://help.ubuntu.com/community/Grub2

Scenarios
#1
Grub_legacy and APM

backup, open and edit menu.list
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.backup
gksudo gedit /boot/grub/menu.lst

find the line:
# defoptions=quiet splash

change it to:
# defoptions=quiet splash apm=power_off

Save the file and update Grub:
sudo update-grub

#2
Grub_2 and APM
backup, open and edit /etc/default/grub
sudo cp /etc/default/grub /etc/default/grub.backup
gksudo gedit /etc/default/grub

find the line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

change it to:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash apm=power_off"

Save the file and update Grub:
sudo update-grub

#3
In addition tell the Kernel module APM to shutdown the computer.
Open this file:
gksudo gedit /etc/modules

add the line:
apm power_off=1

Save the file, reboot and test shutdown.

#4
In case Ubuntu doesn't recognize that computer has ACPI ability, you could try to add boot option to Grub file or on the fly via boot menu:
acpi=force
https://help.ubuntu.com/community/BootOptions

Note: this can leave your system unbootable, you need to know how to reverse, please read tutorials above.

#5
Unplug usb devices before shutdown.
Check BIOS settings.
Before changing anything, write down the settings in order to reverse.
Make sure you know what you're doing.
http://www.pcguide.com/ref/mbsys/bios/set/pm.htm
http://en.wikibooks.org/wiki/LPI_Linux_Certification/Configure_Fundamental_BIOS_Settings

#6
Avoid hard reset, use MagicSysRq.
http://www.ubuntugeek.com/how-to-use-magic-system-request-keys-in-ubuntu-linux.html

Revision history for this message
George A (gka1999) said :
#8

Thanks Sam, that solved my question.

Revision history for this message
George A (gka1999) said :
#9

Greetings actionparsnip and Sam. Thank you for your suggestions and inputs. I tried the suggestions in the order that I received them.
I searched for the line that actionparsnip suggested, but gedit could not find the subject line (I did try several combinations of the options available in the dialog box)– here is the output from Terminal:

gka@Asus-old:~$ gksudo gedit /etc/default/grub; sudo update-grub
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.28-18-generic
Found kernel: /boot/vmlinuz-2.6.28-17-generic
Found kernel: /boot/vmlinuz-2.6.28-11-generic
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done

Sam, yes, my Asus motherboard is about 6 years old. [ during a clean installation of 9.04 I was obliged to turn ACPI off (via F6 then selecting acpi=off noapci ….), since otherwise the installation process would hang. I don't know whether this has any relevance to the present problem]. I read through information provided via the first three links, and then proceeded to implement your line items 1 – 3, and this resolved my problem. Now when the OS is shut down, the PC turns power off automatically. Many thanks for your diligent guidance – without your step by step instructions I could not have navigated the Linux system, the knowledge and details involved are presently “way-over-my-head” . For the sake of completeness here are the results for the steps noted in the instructions:

Here is the result of grub inquiry on my system:

gka@Asus-old:~$ sudo grub-install -v
[sudo] password for gka:
grub-install (GNU GRUB 0.97)
gka@Asus-old:~$

Scenario 1)- output

gka@Asus-old:~$ sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.backup
[sudo] password for gka:
gka@Asus-old:~$ gksudo gedit /boot/grub/menu.lst
gka@Asus-old:~$ sudo update-grub
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.28-18-generic
Found kernel: /boot/vmlinuz-2.6.28-17-generic
Found kernel: /boot/vmlinuz-2.6.28-11-generic
Found kernel: /boot/memtest86+.bin
Replacing config file /var/run/grub/menu.lst with new version
Updating /boot/grub/menu.lst ... done

gka@Asus-old:~$

Scenario 2)- Could not find the line in question, here is the result from Terminal :

gka@Asus-old:~$ sudo cp /etc/default/grub /etc/default/grub.backup
cp: cannot stat `/etc/default/grub': No such file or directory
gka@Asus-old:~$ gksudo gedit /etc/default/grub
gka@Asus-old:~$

3)-
gka@Asus-old:~$ gksudo gedit /etc/modules

I entered my PW, subsequently added the line indicated, saved, and exited.

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

lp
apm power_off=1

gka@Asus-old:~$

Shut down the system and re started (twice). On the second shut down the PC powered off automatically.

Revision history for this message
Sam_ (and-sam) said :
#10

Congratulations George, very well done.
btw. as you've found out yourself, this
grub-install (GNU GRUB 0.97)
is GRUB, not GRUB_2
http://members.iinet.net.au/~herman546/p15.html

Enjoy Ubuntu.