From: frank Date: Mon, 16 Jan 2012 18:37:06 +0000 (+0100) Subject: committing changes in /etc after emerge run X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=e819ba98823855ebba1629e4bd3c6af3717fa885;p=config%2Fbruni%2Fetc.git committing changes in /etc after emerge run Package changes: +sys-power/acpid-2.0.12 --- diff --git a/.etckeeper b/.etckeeper index 898916f4..29289ad7 100755 --- a/.etckeeper +++ b/.etckeeper @@ -71,6 +71,10 @@ maybe chmod 0755 './X11/xinit/xinitrc.d/10-xdg-menu-gnome' maybe chmod 0755 './X11/xinit/xinitrc.d/70-seahorse-agent' maybe chmod 0755 './X11/xinit/xinitrc.d/80-dbus' maybe chmod 0755 './X11/xinit/xinitrc.d/90-consolekit' +maybe chmod 0755 './acpi' +maybe chmod 0755 './acpi/default.sh' +maybe chmod 0755 './acpi/events' +maybe chmod 0644 './acpi/events/default' maybe chmod 0600 './aiccu.conf' maybe chmod 0755 './apache2' maybe chmod 0644 './apache2/httpd.conf' @@ -143,6 +147,7 @@ maybe chmod 0644 './chktexrc' 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/bluetooth' @@ -567,6 +572,7 @@ maybe chmod 0644 './host.conf' maybe chmod 0644 './hosts' maybe chmod 0755 './init.d' maybe chmod 0755 './init.d/NetworkManager' +maybe chmod 0755 './init.d/acpid' maybe chmod 0755 './init.d/aiccu' maybe chmod 0755 './init.d/apache2' maybe chmod 0755 './init.d/auditd' diff --git a/acpi/default.sh b/acpi/default.sh new file mode 100755 index 00000000..9fe26a16 --- /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 00000000..a07c1827 --- /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 00000000..30329760 --- /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 00000000..946e39bf --- /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 $? +}