From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98) Description of problem: After completing a laptop installation, my Compaq 1655 (266 MHz PII, 64M RAM) will not power off. It shuts down correctly, but just doesn't power off the machine. The APM daemon successfully starts and shuts down. How reproducible: Always Steps to Reproduce: 1.logout of session 2.select shutdown from login screen Actual Results: Halts system, but does not turn off laptop Expected Results: halt system and shut off laptop Additional info: this is my halt script located in /etc/rc.d/init.d #!/bin/bash # # rc.halt This file is executed by init when it goes into runlevel # 0 (halt) or runlevel 6 (reboot). It kills all processes, # unmounts file systems and then either halts or reboots. # # Author: Miquel van Smoorenburg, <miquels.mugnet.org> # Modified for RHS Linux by Damien Neil # # Set the path. PATH=/sbin:/bin:/usr/bin:/usr/sbin export NOLOCALE=1 . /etc/init.d/functions runcmd() { echo -n $"$1 " shift if [ "$BOOTUP" = "color" ]; then $* && echo_success || echo_failure else $* fi echo } # See how we were called. case "$0" in *halt) message=$"Halting system..." command="halt" ;; *reboot) message=$"Please stand by while rebooting the system..." command="reboot" ;; *) echo $"$0: call me as 'rc.halt' or 'rc.reboot' please!" exit 1 ;; esac if [ -n "$1" ]; then case "$1" in *start) ;; *) echo $"Usage: (halt|reboot) {start}" exit 1 ;; esac fi # Kill all processes. [ "${BASH+bash}" = bash ] && enable kill runcmd $"Sending all processes the TERM signal..." /sbin/killall5 -15 sleep 5 runcmd $"Sending all processes the KILL signal..." /sbin/killall5 -9 # Write to wtmp file before unmounting /var halt -w # Save mixer settings, here for lack of a better place. grep -q "\(sparcaudio\|sound\)" /proc/devices if [ $? = 0 -a -x /bin/aumix-minimal ]; then runcmd $"Saving mixer settings" /bin/aumix-minimal -f /etc/.aumixrc -S fi # Sync the system clock. ARC=0 SRM=0 UTC=0 if [ -f /etc/sysconfig/clock ]; then . /etc/sysconfig/clock # convert old style clock config to new values if [ "${CLOCKMODE}" = "GMT" ]; then UTC=true elif [ "${CLOCKMODE}" = "ARC" ]; then ARC=true fi fi CLOCKDEF="" CLOCKFLAGS="--systohc" case "$UTC" in yes|true) CLOCKFLAGS="$CLOCKFLAGS -u"; CLOCKDEF="$CLOCKDEF (utc)"; ;; no|false) CLOCKFLAGS="$CLOCKFLAGS --localtime"; CLOCKDEF="$CLOCKDEF (localtime)"; ;; esac case "$ARC" in yes|true) CLOCKFLAGS="$CLOCKFLAGS -A"; CLOCKDEF="$CLOCKDEF (arc)"; ;; esac case "$SRM" in yes|true) CLOCKFLAGS="$CLOCKFLAGS -S"; CLOCKDEF="$CLOCKDEF (srm)"; ;; esac runcmd $"Syncing hardware clock to system time" /sbin/hwclock $CLOCKFLAGS # Turn off swap, then unmount file systems. SWAPS=`awk '! /^Filename/ { print $1 }' /proc/swaps` [ -n "$SWAPS" ] && runcmd $"Turning off swap: " swapoff $SWAPS [ -x /sbin/accton ] && runcmd $"Turning off accounting: " /sbin/accton [ -x /sbin/quotaoff ] && runcmd $"Turning off quotas: " /sbin/quotaoff -a # Unmount file systems, killing processes if we have to. # Unmount loopback stuff first remaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $2}' /proc/mounts` [ -n "$remaining" ] && { sig= retry=3 while [ -n "$remaining" -a "$retry" -gt 0 ] do if [ "$retry" -lt 3 ]; then runcmd $"Unmounting loopback filesystems (retry):" umount $remaining else runcmd $"Unmounting loobpack filesystems: " umount $remaining fi remaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $2}' /proc/mounts` [ -z "$remaining" ] && break /sbin/fuser -k -m $sig $remaining >/dev/null sleep 5 retry=$(($retry -1)) sig=-9 done } sig= retry=3 remaining=`awk '!/(^#|proc|loopfs|autofs|^none|^\/dev\/root| \/ )/ {print $2}' /proc/mounts` while [ -n "$remaining" -a "$retry" -gt 0 ] do if [ "$retry" -lt 3 ]; then LANG=C runcmd $"Unmounting file systems (retry): " umount -a -f -t noproc else LANG=C runcmd $"Unmounting file systems: " umount -a -f - t noproc fi sleep 2 remaining=`awk '!/(^#|proc|loopfs|autofs|^none|^\/dev\/root| \/ )/ {print $2}' /proc/mounts` [ -z "$remaining" ] && break /sbin/fuser -k -m $sig $remaining >/dev/null sleep 5 retry=$(($retry-1)) sig=-9 done [ -f /proc/bus/usb/devices ] && umount /proc/bus/usb # Remount read only anything that's left mounted. #echo $"Remounting remaining filesystems (if any) readonly" mount | awk '/ext2/ { print $3 }' | while read line; do mount -n -o ro,remount $line done runcmd $"Unmounting proc file system: " umount /proc # Now halt or reboot. echo $"$message" if [ -f /fastboot ]; then echo $"On the next boot fsck will be skipped." elif [ -f /forcefsck ]; then echo $"On the next boot fsck will be forced." fi HALTARGS="-i -d" if [ -f /poweroff -o ! -f /halt ]; then HALTARGS="$HALTARGS -p" fi if [ "$command" = halt ] ; then if [ -r /etc/ups/upsmon.conf -a -f /etc/killpower -a - f /etc/sysconfig/ups ] ; then . /etc/sysconfig/ups [ "$SERVER" = "yes" -a "$MODEL" != "NONE" -a -n "$MODEL" -a - n "$DEVICE" ] && $MODEL -k $DEVICE fi fi eval $command $HALTARGS
Does it power down if you give it the command "poweroff" as root?
Yes, it does powerdown properly when giving the command "poweroff" and "halt - p". What gives?
It means it's by no means an apmd or kernel bug, but whatever you're using to shut down the system is running halt or shutdown -h now rather than halt -p or shutdown -p -h now or poweroff. What "login screen" are you referring to? (kdm, gdm, xdm)?
I am using kdm login.
You're right, kdm defaults to using /sbin/halt to shut down the system (one of the things you never notice if you're running in runlevel 3 and using startx only when you need X...) I'll change this in the next build.
I have just found another related problem to kdm, I think. When I log into a failsafe session from the kdm login screen, my mouse works; however, my keyboard doesn't. Is this a kdm problem too?
Unlikely, since it works for me. I presume you're aware of the fact that in twm, the window focus follows the mouse (so the mouse cursor must be in the window you're typing in)?
The focus doesn't seem to make a difference. I can click in the box, highlight lines (with the mouse), but not type.
Fixed kdm configuration; for the failsave problem, please open a new bug against XFree86. If anything, this must be an X problem (no part of KDE is running at that time).