diff -Nru /tmp/wrzXXfI0p6/acpid-1.0.4/debian/changelog /tmp/ukixw7dPqc/acpid-1.0.4/debian/changelog --- /tmp/wrzXXfI0p6/acpid-1.0.4/debian/changelog 2006-02-15 14:05:45.000000000 +0000 +++ /tmp/ukixw7dPqc/acpid-1.0.4/debian/changelog 2006-05-27 16:07:33.000000000 +0100 @@ -1,3 +1,12 @@ +acpid (1.0.4-1ubuntu11) dapper; urgency=low + + * Fix /etc/acpi/powerbtn.sh so that it doesn't bork if 'pidof' returns + multiple results. This stops the machine displaying the logout + dialogue and then immediately shutting down anyway. + (Closes: Ubuntu #46319) + + -- Paul Sladen Sat, 27 May 2006 15:54:53 +0100 + acpid (1.0.4-1ubuntu10) dapper; urgency=low * Add support to set the group of the log file when acpid starts. diff -Nru /tmp/wrzXXfI0p6/acpid-1.0.4/debian/powerbtn.sh /tmp/ukixw7dPqc/acpid-1.0.4/debian/powerbtn.sh --- /tmp/wrzXXfI0p6/acpid-1.0.4/debian/powerbtn.sh 2006-02-15 11:54:36.000000000 +0000 +++ /tmp/ukixw7dPqc/acpid-1.0.4/debian/powerbtn.sh 2006-05-27 16:06:03.000000000 +0100 @@ -3,30 +3,23 @@ # Initiates a shutdown when the power putton has been # pressed. -[ -f /var/lock/acpisleep ] && exit 0 +# Skip if we just in the middle of resuming. +test -f /var/lock/acpisleep && exit 0 -# If gnome-power-manager is running, let it handle policy -if [ `pidof gnome-power-manager` ]; then - exit -fi - -# Check for kpowersave -if [ `pidof kpowersave` ]; then - exit -fi +# If gnome-power-manager, kpowersave or klaptopdaemon are running, let +# them handle policy This is effectively the same as 'acpi-support's +# '/usr/share/acpi-support/policy-funcs' file. -# And for kded/klaptopdaemon -if test -f /usr/bin/dcop; then - if [ "x$(dcop kded | grep klaptopdaemon)" != x ]; then +if pidof gnome-power-manager kpowersave > /dev/null || + (pidof dcopserver > /dev/null && test -x /usr/bin/dcop && /usr/bin/dcop kded kded loadedModules | grep -q klaptopdaemon) ; then exit - fi fi # Otherwise, if KDE is found, try to ask it to logout. # If KDE is not found, just shutdown now. -if ps -Af | grep -q '[k]desktop' && test -f /usr/bin/dcop -then - dcop --all-sessions --all-users ksmserver ksmserver logout 0 2 0 && exit 0 -else - /sbin/shutdown -h now "Power button pressed" +if ps -Af | grep -q '[k]desktop' && pidof dcopserver > /dev/null && test -x /usr/bin/dcop ; then + /usr/bin/dcop --all-sessions --all-users ksmserver ksmserver logout 0 2 0 && exit 0 fi + +# If all else failed, just initiate a plain shutdown. +/sbin/shutdown -h now "Power button pressed"