Linux - Laptop and NetbookHaving a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
when i use the battstat gnome applet, it constantly takes up from 13%-19% of proc usage. as soon as i remove it usage goes straight to 0%. This is a new installation of Slack9.1 and i used the bareacpi.i kernel. when i used just the bare.i and loaded the apm mod manually, i didnt have this problem. is there a fix or should i just change back to the old way of doing it?
it seems acpi isnt doing anything for me at all. when i close the top for the laptop, everything still runs unlike apm when i closed it it went into standby. i would think it didnt work if not for the battstat applet. is there a acpi config somewhere i should take a look at?
my power button no longer works either, i have to shutdown via "shutdown -h now" to get it to shut off.
even more.... i check the logs for acpid and this is what i found
/var/log/acpid:
[Sun Oct 19 04:18:46 2003] received event "button/power PBTN 00000080 00000005"
[Sun Oct 19 04:18:46 2003] executing action "/etc/acpi/acpi_handler.sh button/power PBTN 00000080 00000005"
[Sun Oct 19 04:18:46 2003] BEGIN HANDLER MESSAGES
[Sun Oct 19 04:18:46 2003] END HANDLER MESSAGES
[Sun Oct 19 04:18:46 2003] action exited with status 0
[Sun Oct 19 04:18:46 2003] completed event "button/power PBTN 00000080 00000005"
/etc/acpi/acpi_handler.sh contents:
#!/bin/sh
# Default acpi script that takes an entry for all actions
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
im lost......
edit: not any more
i read some of your previous posts about acpi and got all the info i needed from them, except still no standby mode when lid is closed.
# Load config
if [ -f /etc/acpi/actions/functions ]; then
. /etc/acpi/actions/functions
else
exit 1
fi
# Take action
if lid_open ; then
screen_power on
else # lid closed
# we do nothing if we are on AC power, as we probably have an
# external monitor present. Best of course would be to test
# for prescence of external monitor, but don't know how
if ! ac_online; then
screen_power off
fi
fi
/etc/acpi/actions/ac_adapter
!/bin/sh
# Acts on AC power change status
# Load config
if [ -f /etc/acpi/actions/functions ]; then
. /etc/acpi/actions/functions
else
exit 1
fi
if [ -f /etc/acpi/actions/config ]; then
. /etc/acpi/actions/config
fi
# Since APM is not available the APM script cannot handle
# the power changes (the apm command to query power status does not work).
# We emulate behaviour of APM script.
. $APMCONFIG
# Act on power related services, arg must be 'start' or 'stop'
power_services () {
[ -z "$POWER_SERVICES" ] && return
for i in $POWER_SERVICES; do
/sbin/service $i $1
done
}
# Adjusts CPU power setting, arg must be 'high' or 'low'
# Method depends on CPUPOWER variable
cpu_power () {
if [ -f /var/lock/subsys/cpudynd -a "$CPUPOWER" != "cpudyn" ]; then
echo "WARN: cpudyn service apparantly running but using non cpudyn method" 2>&1
fi
case "$CPUPOWER" in
cpudyn)
if [ ! -f /var/lock/subsys/cpudynd ]; then
echo "ERROR: cpudynd service not running" 1>&2
return
fi
if [ "$1" == "high" ]; then
killall -USR1 cpudynd # lock cpudynd at maximum
else
killall -HUP cpudynd # let cpudynd dynamically adjust
fi
;;
cpufreq)
if [ ! -f /proc/cpufreq ]; then
echo "ERROR: cpufreq support not present" 1>&2
return
fi
if [ "$1" == "high" ]; then
echo -n "0%${CPUFREQ_MIN_AC}%${CPUFREQ_MAX_AC}%${CPUFREQ_POL_AC}" > /proc/cpufreq
else
echo -n ""0%${CPUFREQ_MIN_BAT}%${CPUFREQ_MAX_BAT}%${CPUFREQ_POL_BAT}"" > /proc/cpufreq
fi
;;
acpi)
if [ ! -f /proc/acpi/processor/CPU0/performance ]; then
echo "ERROR: ACPI processor support not present" 1>&2
return
fi
if [ "$1" == "high" ]; then
echo -n 0 > /proc/acpi/processor/CPU0/performance
else
n=`sed '/^state count:/{s/[^0-6]*//;p};d' < /proc/acpi/processor/CPU0/performance`
n="$[$n-1]"
echo -n $n > /proc/acpi/processor/CPU0/performance
fi
;;
off)
;;
*)
echo "ERROR: invalid CPUPOWER value" 1>&2
esac
}
# Act on change
if ac_online; then
power_services start
cpu_power high
if [ -x /etc/acpi/actions/laptop-mode ]; then
/etc/acpi/actions/laptop-mode stop
fi
else # AC off-line
power_services stop
cpu_power low
if [ -x /etc/acpi/actions/laptop-mode ]; then
/etc/acpi/actions/laptop-mode start
fi
fi
exit 0
/etc/acpi/actions/functions
#!/bin/sh
#
# Setup
#
# Check prescense of /proc filesystem
if [ ! -d /proc ]; then
echo "ERROR: /proc filesystem not present" 1>&2
exit 1
fi
# Autodetect APM script location
if [ -x /etc/sysconfig/apm-scripts/apmscript ]; then
APMSCRIPT=/etc/sysconfig/apm-scripts/apmscript
elif [ -x /etc/apm/apmd_proxy ]; then
APMSCRIPT=/etc/apm/apmd_proxy
else
APMSCRIPT=:
fi
# Autodetect APM config location
if [ -f /etc/sysconfig/apmd ]; then
APMCONFIG=/etc/sysconfig/apmd
else
APMCONFIG=/dev/null
fi
#
# Functions
#
# Check VMware usage
check_vmware_off () {
# we check vmware usage by checking the module usage count for vmmon
local n
[ -f /proc/modules ] || return 0
n=`sed '/^vmmon/{s/vmmon[^0-9]*[0-9]*[^0-9]*\([0-9]*\).*$/\1/;p};d' < /proc/modules`
if [ -z "$n" -o "$n" == "0" ]; then
return 0
else
return 1
fi
}
# Check if nothing that prevents suspending is running
# currently vmware only
check_suspend_ok () {
if [ ! check_vmware_off ]; then
echo "ERROR: vmware is running cannot suspend" 1>&2
return 1
fi
return 0
}
# Execute specified hdparm options on all present hard disks (not cd-roms)
# Currently only IDE
hdparm_all_hd () {
local d
local t
for d in a b c d e f g h i j k l m n o p q r s t ; do
if [ -e /proc/ide/hd$d ] ; then
t=`cat /proc/ide/hd$d/media`
[ "$t" == "disk" ] && hdparm "$@" /dev/hd$d
fi
done
}
# Execute specified hdparm options on all present drives
# Currently only IDE
hdparm_all_drives () {
local d
for d in a b c d e f g h i j k l m n o p q r s t ; do
[ -e /proc/ide/hd$d ] && hdparm "$@" /dev/hd$d
done
}
# Spins all disks down
spin_disks_down () {
hdparm_all_drives -y
}
# Screen power on all active local X servers, arg 1 must be 'on' or 'off'
screen_power () {
local lock pid user disp xauth
if [ "$1" != "on" -a "$1" != "off" ] ; then
echo "ERROR: invalid arg for screen_blanking()" 1>&2
return 1
fi
# do DPMS call on each locally running X server
for lock in /tmp/.X*-lock ; do
[ -O $lock ] || continue # effective ID is always root here
pid=`cat $lock`
pid=`echo $pid` # remove leading spaces
tr '\0' '\n' < /proc/$pid/cmdline | egrep -q '(^|/)X$' || continue;
user=`tr '\0' '\n' < /proc/$pid/environ | sed '/^USER=/{s/.*=//;p};d'`
disp=`tr '\0' '\n' < /proc/$pid/cmdline | grep '^:[0-9][0-9]*$'`
xauth=`tr '\0' '\n' < /proc/$pid/environ | sed '/^XAUTHORITY=/{s/.*=//;p};d'`
[ -z "$disp" ] && continue
[ -n "$xauth" ] && export XAUTHORITY=$xauth
export DISPLAY=$disp
if [ -n "$user" -a "$user" != "root" ]; then
su -s /bin/sh -m -c "/usr/X11R6/bin/xset dpms force $1" $user
else
/usr/X11R6/bin/xset dpms force $1
fi
done
unset DISPLAY
unset XAUTHORITY
}
# Checks if running on AC power
ac_online () {
if [ ! -f /proc/acpi/ac_adapter/AC/state ]; then
echo "ERROR: ACPI AC status support not present" 1>&2
return 0
fi
if LC_ALL=C grep -q on-line < /proc/acpi/ac_adapter/AC/state; then
return 0
else
return 1
fi
}
# Checks if lid is open
lid_open () {
if [ ! -f /proc/acpi/button/lid/LID/state ]; then
echo "ERROR: ACPI button support not present" 1>&2
return 0
fi
if LC_ALL=C grep -q open < /proc/acpi/button/lid/LID/state; then
return 0
else
return 1
fi
}
/etc/acpi/actions/suspend
#!/bin/sh
# Sleep to ACPI S1 state. Higher states not supported on Linux 2.4.x
# Load config
if [ -f /etc/acpi/actions/functions ]; then
. /etc/acpi/actions/functions
else
exit 1
fi
if [ ! -f /proc/acpi/sleep ]; then
echo "ERROR: ACPI support not present" 1>&2
exit 1
fi
LOCKFILE=/var/lock/subsys/acpi-suspend
if [ -f $LOCKFILE ]; then
pid=`cat $LOCKFILE`
wall "ACPI suspend requested but previous suspend process still going (PID $pid)"
exit 1
fi
# Check that suspend would be OK
check_suspend_ok || exit 1
# Start suspend process
echo $$ > "$LOCKFILE"
screen_power off
# Perform APM configured suspend settings
"$APMSCRIPT" standby user
sync
spin_disks_down
# Suspend
echo -n "1" > /proc/acpi/sleep
# Resume back to normal
"$APMSCRIPT" resume standby
screen_power on
rm -f "$LOCKFILE"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.