Home > acpi, Debian, docs, GNU/Linux, tips > More faster acpi shutdown on Debian – Change your ACPI script

More faster acpi shutdown on Debian – Change your ACPI script


When i need much RAM DISK , my Desktop are freeze … ughhh .. . So, i must press power button to shutdown. But, that not working until must pressed along 5 seconds. But u know, my hardisk be broken… scream .. awwwwwww….

i’m getting this problem since i was confusing with acpi on debian not working as normally slackware distribtion. Acpi Script is suck. Check acpi script on your debian distribution at /etc/acpi/ . or like this

#!/bin/sh
# /etc/acpi/powerbtn.sh
# Initiates a shutdown when the power putton has been
# pressed.
# Skip if we just in the middle of resuming.
test -f /var/lock/acpisleep && exit 0
# 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.
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
# 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' && pidof dcopserver > /dev/null && test -x /usr/bin/dcop ; then
KDESES=`pidof dcopserver | wc -w`
if [ $KDESES -eq 1 ] ; then
# single KDE session -> ask user
/usr/bin/dcop --all-sessions --all-users ksmserver ksmserver logout 1 2 0
exit 0
else
# more than one KDE session - just send shutdown signal to all of them
/usr/bin/dcop --all-sessions --all-users ksmserver ksmserver logout 0 2 0 && exit 0
fi
fi
# If all else failed, just initiate a plain shutdown.
/sbin/shutdown -h now "Power button pressed"

and

#!/bin/sh
# /etc/acpi/powerbtn-acpi-support.sh
# This script initiates a shutdown when the power putton has been
# pressed. Loosely based on the sample that ships with the acpid package.
# If the acpid sample is present as a real config file (as it was in earlier
# versions of acpid), we skip this script. (Purging and reinstalling acpid
# resolves this situation, or simply deleting /etc/acpi/events/powerbtn.)
if [ -f /etc/acpi/events/powerbtn ] ; then
echo Acpi-support not handling power button, acpid handler /etc/acpi/events/powerbtn exists.
exit 0
fi
[ -e /usr/share/acpi-support/policy-funcs ] || exit 0
. /usr/share/acpi-support/policy-funcs
# If powersaved is running, let it process the acpi event
if pidof powersaved; then
exit 0
fi
if [ `CheckPolicy` = 0 ] ; then
exit 0
fi
if [ -x /etc/acpi/powerbtn.sh ] ; then
# Compatibility with old config script from acpid package
/etc/acpi/powerbtn.sh
else
# Normal handling.
/sbin/shutdown -h -P now "Power button pressed"
fi

that too much GUI warning, will be slowly system to shutdown -now a.k.a init 0 . so, i need simply shutdown like acpi script on slax distribution. then, i chance like this

#!/bin/sh
# Default acpi script that takes an entry for all actions
IFS=${IFS}/
set $@
case "$1" in
button)
case "$2" in
power) /sbin/init 0
;;
*) logger "ACPI action $2 is not defined"
;;
esac
;;
*)
logger "ACPI group $1 / action $2 is not defined"
;;
esac

and….. it’s work … :mrgreen:

so, i’m not scarry now with freeze desktop 😛

ok, goood luck .. 😉

Advertisements
Categories: acpi, Debian, docs, GNU/Linux, tips
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s