From 45dde252420f7c8bc63aa5315dfec8815f3e72cf Mon Sep 17 00:00:00 2001 From: frank Date: Tue, 6 Mar 2012 10:10:42 +0100 Subject: [PATCH] committing changes in /etc after emerge run Package changes: +sys-power/acpid-2.0.12 --- .etckeeper | 6 +++++ acpi/default.sh | 59 +++++++++++++++++++++++++++++++++++++++++++++ acpi/events/default | 19 +++++++++++++++ conf.d/acpid | 6 +++++ init.d/acpid | 28 +++++++++++++++++++++ 5 files changed, 118 insertions(+) create mode 100755 acpi/default.sh create mode 100644 acpi/events/default create mode 100644 conf.d/acpid create mode 100755 init.d/acpid diff --git a/.etckeeper b/.etckeeper index 40b757b..c3fa644 100755 --- a/.etckeeper +++ b/.etckeeper @@ -45,6 +45,10 @@ maybe chmod 0755 './X11' maybe chmod 0755 './X11/xinit' maybe chmod 0755 './X11/xinit/xinitrc.d' maybe chmod 0755 './X11/xinit/xinitrc.d/80-dbus' +maybe chmod 0755 './acpi' +maybe chmod 0755 './acpi/default.sh' +maybe chmod 0755 './acpi/events' +maybe chmod 0644 './acpi/events/default' maybe chgrp amavis './amavisd.conf' maybe chmod 0640 './amavisd.conf' maybe chmod 0755 './apache2' @@ -131,6 +135,7 @@ maybe chmod 0644 './clamd.conf' maybe chmod 0644 './colordiffrc' maybe chmod 0644 './colordiffrc-lightbg' maybe chmod 0755 './conf.d' +maybe chmod 0644 './conf.d/acpid' maybe chmod 0644 './conf.d/apache2' maybe chmod 0644 './conf.d/auditd' maybe chmod 0644 './conf.d/autofs' @@ -663,6 +668,7 @@ maybe chmod 0644 './idn.conf.sample' maybe chmod 0644 './idnalias.conf' maybe chmod 0644 './idnalias.conf.sample' maybe chmod 0755 './init.d' +maybe chmod 0755 './init.d/acpid' maybe chmod 0755 './init.d/amavisd' maybe chmod 0755 './init.d/apache2' maybe chmod 0755 './init.d/atd' diff --git a/acpi/default.sh b/acpi/default.sh new file mode 100755 index 0000000..9fe26a1 --- /dev/null +++ b/acpi/default.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# /etc/acpi/default.sh +# Default acpi script that takes an entry for all actions + +set $* + +group=${1%%/*} +action=${1#*/} +device=$2 +id=$3 +value=$4 + +log_unhandled() { + logger "ACPI event unhandled: $*" +} + +case "$group" in + button) + case "$action" in + power) + /sbin/init 0 + ;; + + # if your laptop doesnt turn on/off the display via hardware + # switch and instead just generates an acpi event, you can force + # X to turn off the display via dpms. note you will have to run + # 'xhost +local:0' so root can access the X DISPLAY. + #lid) + # xset dpms force off + # ;; + + *) log_unhandled $* ;; + esac + ;; + + ac_adapter) + case "$value" in + # Add code here to handle when the system is unplugged + # (maybe change cpu scaling to powersave mode). For + # multicore systems, make sure you set powersave mode + # for each core! + #*0) + # cpufreq-set -g powersave + # ;; + + # Add code here to handle when the system is plugged in + # (maybe change cpu scaling to performance mode). For + # multicore systems, make sure you set performance mode + # for each core! + #*1) + # cpufreq-set -g performance + # ;; + + *) log_unhandled $* ;; + esac + ;; + + *) log_unhandled $* ;; +esac diff --git a/acpi/events/default b/acpi/events/default new file mode 100644 index 0000000..a07c182 --- /dev/null +++ b/acpi/events/default @@ -0,0 +1,19 @@ +# /etc/acpi/events/default +# 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 diff --git a/conf.d/acpid b/conf.d/acpid new file mode 100644 index 0000000..3032976 --- /dev/null +++ b/conf.d/acpid @@ -0,0 +1,6 @@ +# /etc/conf.d/acpid: config file for /etc/init.d/acpid + +# Options to pass to the acpid daemon. +# See the acpid(8) man page for more info. + +ACPID_OPTIONS="" diff --git a/init.d/acpid b/init.d/acpid new file mode 100755 index 0000000..946e39b --- /dev/null +++ b/init.d/acpid @@ -0,0 +1,28 @@ +#!/sbin/runscript +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-power/acpid/files/acpid-2.0.11-init.d,v 1.7 2011/12/04 10:33:21 swegener Exp $ + +extra_started_commands="reload" +command="/usr/sbin/acpid" +command_args="${ACPID_OPTIONS}" +start_stop_daemon_args="--quiet" +description="Daemon for Advanced Configuration and Power Interface" + +depend() { + need localmount + use logger +} + +if [ "${RC_VERSION:-0}" = "0" ]; then + start() { + eerror "This script cannot be used for baselayout-1." + return 1 + } +fi + +reload() { + ebegin "Reloading acpid configuration" + start-stop-daemon --exec $command --signal HUP + eend $? +} -- 2.39.5