Here's a bootscript I made with some files it uses.
/etc/rc.d/init.d/acpid
Code:
. /etc/sysconfig/rc
. $rc_functions
case "$1" in
start)
echo "Starting acpid..."
if [ ! -e /proc/acpi ]; then
echo -n "ACPI support has not been compiled into the kernel"
echo_failure
else
loadproc /usr/sbin/acpid -c /etc/acpi/events
fi
;;
stop)
echo "Stopping acpid..."
killproc /usr/sbin/acpid
;;
restart)
$0 stop
sleep 1
$0 start
;;
status)
statusproc /usr/bin/acpid
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
/etc/acpi/events/default (from Gentoo)
Code:
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-power/acpid/files/acpid-1.0.4-default,v 1.2 2005/04/24 16:21:45 brix Exp $
# This is the ACPID default configuration, it takes all
# events and passes them to /etc/acpi/default.sh for further
# processing.
# event keeps a regular expression matching the event. To get
# power events only, just use something like "event=button[ /]power.*"
# to catch it.
# action keeps the command to be executed after an event occurs
# In case of the power event above, your entry may look this way:
#event=button[ /]power.*
#action=/sbin/init 0
# Optionally you can specify the placeholder %e. It will pass
# through the whole kernel event message to the program you've
# specified.
event=.*
action=/etc/acpi/default.sh %e
/etc/acpi/default.sh
Code:
#!/bin/sh
# Default acpi script that takes an entry for all actions
set $*
group=${1/\/*/}
action=${1/*\//}
case "$group" in
button)
case "$action" in
power) /sbin/init 0
;;
esac
;;
*) logger "ACPI action $action is not defined"
;;
esac
;;
*)
logger "ACPI group $group / action $action is not defined"
;;
esac