--- acpid-1.0.4.orig/acpid.h +++ acpid-1.0.4/acpid.h @@ -35,6 +35,8 @@ #define ACPI_SOCKETFILE "/var/run/acpid.socket" #define ACPI_SOCKETMODE 0666 #define ACPI_MAX_ERRS 5 +#define ACPI_LOCKFILE "/var/lock/acpid" +#define ACPI_LOGFILE_GROUP "adm" #define PACKAGE "acpid" --- acpid-1.0.4.orig/examples/default.sh +++ acpid-1.0.4/examples/default.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# Default acpi script that takes an entry for all actions + +set $* + +# Take care about the way events are reported +ev_type=`echo "$1" | cut -d/ -f1` +if [ "$ev_type" = "$1" ]; then + event="$2"; +else + event=`echo "$1" | cut -d/ -f2` +fi + + +case "$ev_type" in + button) + case "$event" in + power) + logger "acpid: received a shutdown request" + /sbin/init 0 + break + ;; + *) + logger "acpid: action $2 is not defined" + ;; + esac + ;; + + *) + logger "ACPI group $1 / action $2 is not defined" + ;; +esac --- acpid-1.0.4.orig/examples/default +++ acpid-1.0.4/examples/default @@ -0,0 +1,18 @@ +# 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 --- acpid-1.0.4.orig/examples/ac.sh +++ acpid-1.0.4/examples/ac.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# /etc/acpid/ac.sh +# Detect loss of AC power and regaining of AC power, and take action +# appropriatly. + +# On my laptop anyway, this script doesn't not get different parameters for +# loss of power and regained power. So, I have to use a separate program to +# tell what the adapter status is. + +# This uses the spicctrl program for probing the sonypi device. +BACKLIGHT=$(spicctrl -B) + +if on_ac_power; then + # Now on AC power. + + # Tell longrun to go crazy. + longrun -f performance + longrun -s 0 100 + + # Turn up the backlight unless it's up far enough. + if [ "$BACKLIGHT" -lt 108 ]; then + spicctrl -b 108 + fi +else + # Now off AC power. + + # Tell longrun to be a miser. + longrun -f economy + longrun -s 0 50 # adjust to suite.. + + # Don't allow the screen to be too bright, but don't turn the + # backlight _up_ on removal, and don't turn it all the way down, as + # that is unusable on my laptop in most conditions. Adjust to + # taste. + if [ "$BACKLIGHT" -gt 68 ]; then + spicctrl -b 68 + fi +fi + --- acpid-1.0.4.orig/examples/ac +++ acpid-1.0.4/examples/ac @@ -0,0 +1,11 @@ +# /etc/acpid/events/ac +# This detects changes to AC power status, and passes them to +# /etc/acpi/ac.sh for further processing. + +# Optionally you can specify the placeholder %e. It will pass +# through the whole kernel event message to the program you've +# specified. + +event=ac_adapter +action=/etc/acpi/ac.sh + --- acpid-1.0.4.orig/acpi_listen.8 +++ acpid-1.0.4/acpi_listen.8 @@ -1,4 +1,4 @@ -.TH acpi_listen 17 "Nov 2003" +.TH acpi_listen 8 "Nov 2003" .\" Copyright (c) 2003 Sun Microsystems (thockin@sun.com) .\" Some parts (C) 2003 - Gismo / Luca Capello http://luca.pca.it .SH NAME @@ -7,7 +7,7 @@ \fBacpi_listen\fP [\fIoptions\fP] .SH DESCRIPTION -\fBacpid\fP is the sysem-wide ACPI event catcher. \fBacpi_listen\fP is a +\fBacpid\fP is the system-wide ACPI event catcher. \fBacpi_listen\fP is a simple shell-friendly tool which connects to acpid and listens for events. When an event occurs, acpi_listen will print it on stdout. --- acpid-1.0.4.orig/ud_socket.c +++ acpid-1.0.4/ud_socket.c @@ -58,7 +58,7 @@ while (1) { int newsock = 0; struct sockaddr_un cliaddr; - int len = sizeof(struct sockaddr_un); + socklen_t len = sizeof(struct sockaddr_un); newsock = accept(listenfd, (struct sockaddr *)&cliaddr, &len); if (newsock < 0) { --- acpid-1.0.4.orig/debian/acpid.postinst +++ acpid-1.0.4/debian/acpid.postinst @@ -0,0 +1,30 @@ +#!/bin/sh + +set -e + +# Remove shutdown and reboot links; this init script does not need them. +if dpkg --compare-versions "$2" lt "1.0.4-5ubuntu2"; then + rm -f /etc/rc0.d/K21acpid /etc/rc6.d/K21acpid +fi + +HAL_NEEDS_RESTARTING=no +case "$1" in + configure|reconfigure) + # + if [ -x /etc/init.d/hal ] && dpkg --compare-versions "$2" ge-nl 1.0.4-5ubuntu4 && [ -f /var/run/hald/hald.pid ]; then + HAL_NEEDS_RESTARTING=yes + invoke-rc.d hal stop + fi + ;; +esac + +#DEBHELPER# + +case "$1" in + configure|reconfigure) + if [ -x /etc/init.d/hal ] && dpkg --compare-versions "$2" ge-nl 1.0.4-5ubuntu4 && [ "$HAL_NEEDS_RESTARTING" = "yes" ]; then + invoke-rc.d hal start + fi + ;; +esac + --- acpid-1.0.4.orig/debian/rules +++ acpid-1.0.4/debian/rules @@ -0,0 +1,53 @@ +#! /usr/bin/make -f + +build: build-stamp + +build-stamp: + dh_testdir + chmod g-s -R * + $(MAKE) + $(MAKE) man + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + -$(MAKE) clean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean + dh_installdirs + # Install powerbtn.sh script and make it executable + install -m 755 -D debian/powerbtn.sh debian/acpid/etc/acpi/powerbtn.sh + +binary: binary-arch binary-indep + +binary-indep: + +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installlogrotate + dh_installinit -- multiuser 10 21 + dh_install + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +.PHONY: build clean binary-indep binary-arch binary install --- acpid-1.0.4.orig/debian/powerbtn.sh +++ acpid-1.0.4/debian/powerbtn.sh @@ -0,0 +1,33 @@ +#!/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" --- acpid-1.0.4.orig/debian/acpid.default +++ acpid-1.0.4/debian/acpid.default @@ -0,0 +1,12 @@ +# Specify options for acpid startup, Debian default is to enable the +# use of sockets at a non-default position +OPTIONS="-s /var/run/acpid.socket" + +# Specify modules to load on acpid's startup +# MODULES may be uncommented to load "none", contain the string "all" +# to load all acpi related modules or simply a space seperated list +# of modules to be probed. +#MODULES="battery ac processor button fan thermal" +# using all allows us to drop extra modules in drivers/acpi and have them +# be autoloaded. +MODULES="all" --- acpid-1.0.4.orig/debian/control +++ acpid-1.0.4/debian/control @@ -0,0 +1,24 @@ +Source: acpid +Section: admin +Priority: optional +Maintainer: Ubuntu Core developers +XSBC-Original-Maintainer: Cajus Pollmeier +Standards-Version: 3.6.2 +Build-Depends: debhelper (>= 4.1.16) + +Package: acpid +Architecture: i386 ia64 amd64 lpia +Depends: ${shlibs:Depends}, lsb-base (>= 1.3-9ubuntu3), module-init-tools (>=3.1-rel-2ubuntu2), sysv-rc (>= 2.86.ds1-14.1ubuntu2) +Description: Utilities for using ACPI power management + Modern computers support the Advanced Configuration and Power Interface (ACPI) + to allow intelligent power management on your system and to query battery and + configuration status. + . + ACPID is a completely flexible, totally extensible daemon for delivering + ACPI events. It listens on a file (/proc/acpi/event) and when an event + occurs, executes programs to handle the event. The programs it executes + are configured through a set of configuration files, which can be + dropped into place by packages or by the admin. + . + In order to use this package you need a recent Kernel (=>2.4.7). This can be + one including the patches on http://acpid.sourceforge.net or a non patched one. --- acpid-1.0.4.orig/debian/acpid.docs +++ acpid-1.0.4/debian/acpid.docs @@ -0,0 +1 @@ +README --- acpid-1.0.4.orig/debian/changelog +++ acpid-1.0.4/debian/changelog @@ -0,0 +1,668 @@ +acpid (1.0.4-5ubuntu9.1) hardy-proposed; urgency=low + + * event.c: Close the client file descriptor on disconnect. Otherwise the + limit will be reached and the logfile is filled with errors. (LP: + #270259) + + -- Timo Aaltonen Fri, 14 Nov 2008 11:33:16 +0200 + +acpid (1.0.4-5ubuntu9) hardy; urgency=low + + [ Daniel Hahler ] + * debian/acpid.postinst: Stop and start hal, if present. + This allows acpid to take /proc/acpi/event and hal will ignore this kernel + interface, when acpid is installed. (LP: #63450) + * debian/acpid.init.d: Add "--oknodo" to the start-stop-daemon call in + "start". The action must not fail, if acpid is already running. + + [ Michael Vogt ] + * debian/acpid.postinst: do not restart hal on dapper upgrades + (hal may hang forever because of a incompatible dbus) + * only restart if hal is actually running + + -- Michael Vogt Wed, 16 Apr 2008 16:12:12 +0200 + +acpid (1.0.4-5ubuntu8) gutsy; urgency=low + + * Fix the broken Maintainer lines in debian/control. + + -- Adam Conrad Wed, 15 Aug 2007 23:47:42 +1000 + +acpid (1.0.4-5ubuntu7) gutsy; urgency=low + + * Build package for lpia. + * Set Ubuntu maintainer address. + + -- Matthias Klose Fri, 10 Aug 2007 21:43:04 +0000 + +acpid (1.0.4-5ubuntu6) feisty; urgency=low + + * Load drivers from ubuntu directory as well as kernel acpi directory + + -- Matthew Garrett Sat, 10 Mar 2007 15:04:34 +0000 + +acpid (1.0.4-5ubuntu5) feisty; urgency=low + + * KubuntuFeistyLaptop spec: change debian/powerbtn.sh for KDE sessions: + * single KDE session: issue KDE logout dialog for user to decide + * multiple KDE sessions: send shutdown request to all KDE sessions + (this is the same behaviour as before) + + -- Luka Renko Thu, 8 Feb 2007 10:28:09 +0100 + +acpid (1.0.4-5ubuntu4) edgy; urgency=low + + * Call modprobe with -b to allow user blacklisting. Ubuntu: #49017 + + -- Scott James Remnant Thu, 14 Sep 2006 15:13:52 +0100 + +acpid (1.0.4-5ubuntu3) edgy; urgency=low + + * Add forgotten versioned-dependency on sysv-rc to get new update-rc.d + behaviour. Go me. + + -- Scott James Remnant Fri, 21 Jul 2006 01:22:57 +0100 + +acpid (1.0.4-5ubuntu2) edgy; urgency=low + + * Remove stop links from rc0 and rc6 + + -- Scott James Remnant Thu, 20 Jul 2006 23:14:18 +0100 + +acpid (1.0.4-5ubuntu1) edgy; urgency=low + + * Merge from debian unstable, remaining changes: + - Lock file and groups, + - LSB init script, + - init script level change, + - load all modules by default, + - Power button handling changes. + + -- Scott James Remnant Tue, 11 Jul 2006 17:50:13 +0100 + +acpid (1.0.4-5) unstable; urgency=low + + * Fixed problem with logrotate and Xorg where the /proc/acpi/events gets + locked by Xorg. + + -- Cajus Pollmeier Sun, 15 Jan 2006 22:23:05 +0100 + +acpid (1.0.4-4) unstable; urgency=low + + Changes by Michael Biebl: + * Adapted scripts in /etc/acpi/ to let powersaved process the acpi event if + it is running. + * Updated standards version to 3.6.2. + * Cleaned up debian/rules, make use of dh_* tools. Created the necessary + acpid.* files. + * Cleaned up debian/*, removed unused and unnecessary files. + * Fixed package to make lintian/linda happy. + + Changes by Cajus Pollmeier: + * Removed debconf integration (Closes: #336725, #336726, #333759, #331512) + * Fixed typo in acpi_listen manpage (Closes: #342743) + + -- Cajus Pollmeier Sat, 14 Jan 2006 11:52:33 +0100 + +acpid (1.0.4-3) unstable; urgency=low + + * Added russian debconf translations (Closes: #324084) + * Added portuguese debconf translations (Closes: #329872) + * Included alternative dependency to debconf-2.0 + + -- Cajus Pollmeier Thu, 29 Sep 2005 11:08:25 +0200 + +acpid (1.0.4-2) unstable; urgency=low + + * Added logrotate control file (Closes: #306235) + * Added vietnamese debconf translations (Closes: #307598) + * Added basque debconf translations (Closes: #296865) + * Added italian debconf translations (Closes: #288224) + * Fixed amd64 specific type problem (Closes: #315070) + * Re-fixed amd64 specific type problem (Closes: #285063) + * Fixed copyright file by adding one missing original + author (Closes: #290053) + + -- Cajus Pollmeier Sat, 9 Jul 2005 12:39:49 +0200 + +acpid (1.0.4-1ubuntu11) dapper; urgency=low + + * Fix /etc/acpi/powerbtn.sh so that it doesn't bork if 'pidof' returns + multiple results. This stops the machine displaying the logout + dialogue and then immediately shutting down anyway. + (Closes: Ubuntu #46319) + + -- Paul Sladen Sat, 27 May 2006 15:54:53 +0100 + +acpid (1.0.4-1ubuntu10) dapper; urgency=low + + * Add support to set the group of the log file when acpid starts. + By default this will set it to the adm group. + + -- Daniel Silverstone Wed, 15 Feb 2006 14:04:49 +0000 + +acpid (1.0.4-1ubuntu9) dapper; urgency=low + + * Check for gnome-power-manager rather than PowerManager. The name changed + between dapper and breezy and without this, we would unconditionally shut + the system down on a powerbutton event. + * Also check for kded/klaptopdaemon and kpowersave for KDE options on the + same policy management. + * Closes: malone #31407 + + -- Daniel Silverstone Wed, 15 Feb 2006 11:41:20 +0000 + +acpid (1.0.4-1ubuntu8) breezy; urgency=low + + * Shorten and simplify init script messages + + -- Matt Zimmerman Thu, 15 Sep 2005 11:30:54 -0700 + +acpid (1.0.4-1ubuntu7) breezy; urgency=low + + * If power-manager is running, don't trigger the power button event + ourselves + + -- Matthew Garrett Tue, 30 Aug 2005 18:33:22 +0100 + +acpid (1.0.4-1ubuntu6) breezy; urgency=low + + * Start acpid before dbus is started - hal needs acpid to be running + already + + -- Matthew Garrett Tue, 30 Aug 2005 17:10:48 +0100 + +acpid (1.0.4-1ubuntu5) breezy; urgency=low + + * Interact with the new locking model in acpi-support + * Fix gcc-4.0 compile error + + -- Matthew Garrett Mon, 22 Aug 2005 22:12:52 +0100 + +acpid (1.0.4-1ubuntu4) hoary; urgency=low + + * Turn off kernel printks if we're not verbose during module loading + + -- Thom May Wed, 2 Mar 2005 17:45:36 +0000 + +acpid (1.0.4-1ubuntu3) hoary; urgency=low + + * Check for the presence of a lockfile, and don't process events if it's + there (Ubuntu: #6026) + + -- Thom May Tue, 1 Feb 2005 12:27:44 +0000 + +acpid (1.0.4-1ubuntu2) hoary; urgency=low + + * Use the new -Q argument to modprobe, add depend on the correct + module-init-tools + * Default back to trying to autoload everything (Ubuntu #4077) + + -- Thom May Fri, 14 Jan 2005 13:48:24 +0000 + +acpid (1.0.4-1ubuntu1) hoary; urgency=low + + * Resynchronise with Debian, resolved minor merging conflict. + + -- Martin Pitt Thu, 11 Nov 2004 10:38:26 +0100 + +acpid (1.0.4-1) unstable; urgency=low + + * New upstream release + * I'm dropping support for older, acpi broken kernels now. Time to + clean up. + + -- Cajus Pollmeier Mon, 1 Nov 2004 11:49:33 +0100 + +acpid (1.0.3-21ubuntu1) hoary; urgency=low + + * Resynchronise with Debian. + + -- Scott James Remnant Wed, 27 Oct 2004 12:05:00 +0100 + +acpid (1.0.3-21) unstable; urgency=low + + * Fixed dcop problem for shutdown (Closes:#274339) + + -- Cajus Pollmeier Fri, 1 Oct 2004 11:10:24 +0200 + +acpid (1.0.3-20) unstable; urgency=high + + * Added detection for non files in run-parts code (Closes:#268203) + + -- Cajus Pollmeier Mon, 30 Aug 2004 19:51:41 +0200 + +acpid (1.0.3-19ubuntu12) warty; urgency=low + + * Disable loading the platform specific acpi modules. (Warty #1451) + + -- Thom May Wed, 6 Oct 2004 14:18:58 +0100 + +acpid (1.0.3-19ubuntu11) warty; urgency=low + + * use xargs -r so we don't fail in the case of no acpi modules (Warty #1466) + + -- Thom May Mon, 20 Sep 2004 12:36:52 +0100 + +acpid (1.0.3-19ubuntu10) warty; urgency=low + + * Added versioned depend on lsb-base + + -- Nathaniel McCallum Fri, 3 Sep 2004 14:45:49 -0400 + +acpid (1.0.3-19ubuntu9) warty; urgency=low + + * log_warning_msg for failed modules, don't bomb out tho. (Warty 983, 991) + + -- Thom May Fri, 3 Sep 2004 17:08:34 +0100 + +acpid (1.0.3-19ubuntu8) warty; urgency=low + + * If a module is already loaded, log_success_msg rather than log_warning_msg + + -- Matt Zimmerman Thu, 2 Sep 2004 16:06:16 -0700 + +acpid (1.0.3-19ubuntu7) warty; urgency=low + + * debian/init: pretty initscript + + -- Nathaniel McCallum Thu, 2 Sep 2004 15:06:13 -0400 + +acpid (1.0.3-19ubuntu6) warty; urgency=low + + * install initrd script + + -- Thom May Fri, 27 Aug 2004 17:14:00 +0100 + +acpid (1.0.3-19ubuntu5) warty; urgency=low + + * Revert -4, since that causes the acpid socket to be reaped + + -- Thom May Tue, 24 Aug 2004 10:34:05 +0100 + +acpid (1.0.3-19ubuntu4) warty; urgency=low + + * Ensure acpid starts as early as possible, so we don't melt Scott's laptop + + -- Thom May Thu, 19 Aug 2004 14:04:55 +0100 + +acpid (1.0.3-19ubuntu3) warty; urgency=low + + * Load all modules + + -- Thom May Wed, 18 Aug 2004 14:11:45 +0100 + +acpid (1.0.3-19ubuntu2) warty; urgency=low + + * Get rid of FTBFS errors. + + -- LaMont Jones Sat, 31 Jul 2004 04:49:10 +0000 + +acpid (1.0.3-19ubuntu1) warty; urgency=low + + * Disable superfluous debconf note when acpi support is not present + (Warty Bug#289) + + -- Matt Zimmerman Tue, 27 Jul 2004 13:26:05 -0700 + +acpid (1.0.3-19) unstable; urgency=low + + * Update dutch translations (Closes:#250719) + * Added turkish translations (Closes:#252933) + + -- Cajus Pollmeier Fri, 28 May 2004 19:41:16 +0200 + +acpid (1.0.3-18) unstable; urgency=low + + * Fixed manpage to contain hint to runparts stylish naming convention + in /etc/acpid/events (Closes:#250066) + + -- Cajus Pollmeier Sat, 22 May 2004 10:33:13 +0200 + +acpid (1.0.3-17) unstable; urgency=low + + * Added amd64 to list of supported architectures (Closes:#249055) + + -- Cajus Pollmeier Fri, 14 May 2004 21:22:53 +0200 + +acpid (1.0.3-16) unstable; urgency=low + + * Added czech po-debconf translation (Closes:#247377) + * Modified init scripts start-stop daemon call to retry stopping + acpid after two seconds (Closes:#247130) + * Modified init script to check for ACPI presence in kernel + _before_ doing any actions (Closes:#247490) + + -- Cajus Pollmeier Fri, 7 May 2004 22:27:40 +0200 + +acpid (1.0.3-15) unstable; urgency=low + + * Fixed powerbutton script which did a shutdown when a + KDE user was logged in. Now it skips the shutdown, + because kdm will do it for us. + + -- Cajus Pollmeier Fri, 23 Apr 2004 18:06:16 +0200 + +acpid (1.0.3-14) unstable; urgency=low + + * Fixed postrm script to clean some lost config files. (Closes: #242273) + + -- Cajus Pollmeier Thu, 8 Apr 2004 11:04:05 +0200 + +acpid (1.0.3-13) unstable; urgency=low + + * Removed support for configuring list of modules with debconf. I can't + spend hours in fullfilling all wishes currently. Don't think anyone really + needs this feature - and if: This is more an issue for a tool that detects + hardware than one for the daemon itself. Implicitly closes: #241367. + * Updated init script to skip loading of modules that are not present in + system, but are configured in defaults file. + + -- Cajus Pollmeier Thu, 1 Apr 2004 06:56:27 +0200 + +acpid (1.0.3-12) unstable; urgency=low + + * Fixed possible problem in config script when installing for the + first time (Closes:#241012) + + -- Cajus Pollmeier Tue, 30 Mar 2004 13:06:01 +0200 + +acpid (1.0.3-11) unstable; urgency=low + + * Included danish translations (Closes:#240044) + + -- Cajus Pollmeier Thu, 25 Mar 2004 19:52:46 +0100 + +acpid (1.0.3-10) unstable; urgency=low + + * Avoided overwriting of manual changes in defaults file (Closes:#239635) + * Replaced init call by normal shutdown with more informative + message (Closes:#239583) + * Included upstream changelog (Closes:#235530) + + -- Cajus Pollmeier Tue, 23 Mar 2004 21:33:31 +0100 + +acpid (1.0.3-9) unstable; urgency=low + + * Made acpid close all used filehandles (Closes:#239350) + + -- Cajus Pollmeier Mon, 22 Mar 2004 14:56:57 +0100 + +acpid (1.0.3-8) unstable; urgency=low + + * Fixed clean target of debian/rules to call dh_clean (Closes:#239239) + + -- Cajus Pollmeier Mon, 22 Mar 2004 11:14:36 +0100 + +acpid (1.0.3-7) unstable; urgency=low + + * Added dutch po-debconf translation (Closes:#237816) + * Added greek po-debconf translation (Closes:#237847) + + -- Cajus Pollmeier Sun, 21 Mar 2004 11:40:48 +0100 + +acpid (1.0.3-6) unstable; urgency=low + + * Modified start script to have the 2.6 module loading + style (Closes:#236703) + + -- Cajus Pollmeier Fri, 12 Mar 2004 16:34:42 +0100 + +acpid (1.0.3-5) unstable; urgency=low + + * Changed description to a coffee cooking variant (Closes:#237199) + + -- Cajus Pollmeier Wed, 10 Mar 2004 20:51:52 +0100 + +acpid (1.0.3-4) unstable; urgency=low + + * Fixed typo in template, that made it in again. (Closes:#236005) + * Included French translations, thanks to Clement Stenac. (Closes:#236375) + + -- Cajus Pollmeier Thu, 4 Mar 2004 07:55:24 +0100 + +acpid (1.0.3-3) unstable; urgency=low + + * Included Japanese translations, thanks to Hideki Yamane. (Closes:#235320) + * Included Brazilian Portuguese translations, thanks to + Andre Luis Lopes (Closes:#235462) + * Workaround for non working postinst configure installed. (Closes:#234270) + + -- Cajus Pollmeier Sun, 29 Feb 2004 11:26:06 +0100 + +acpid (1.0.3-2) unstable; urgency=low + + * Added a sleep between stop and start in the init-scripts restart + condition. This should fix the logrotate problem. (Closes:#234283) + + -- Cajus Pollmeier Wed, 25 Feb 2004 13:15:53 +0100 + +acpid (1.0.3-1) unstable; urgency=high + + * New upstream release + + -- Cajus Pollmeier Wed, 25 Feb 2004 10:08:34 +0100 + +acpid (1.0.2-12) unstable; urgency=low + + * Added missing true condition in postinstall script (Closes: #234274) + + -- Cajus Pollmeier Mon, 23 Feb 2004 10:08:19 +0100 + +acpid (1.0.2-11) unstable; urgency=high + + * Switched to invoke-rc.d in prerm script. (Closes: #234161) + * Removed a - for some users - confusing message from debconf + templates. (Closes: #234179) + + -- Cajus Pollmeier Sun, 22 Feb 2004 10:29:11 +0100 + +acpid (1.0.2-10) unstable; urgency=low + + * Fix typo in events file - powerbtn/powerbtn.sh (Closes:#233248) + * Doing workaround in rules to remove setgid bits. Can't upload new + orig.tar.gz. (Closes: #233628) + * Changed the standard 'all' into a list of most common modules + + -- Cajus Pollmeier Tue, 17 Feb 2004 20:28:42 +0100 + +acpid (1.0.2-9) unstable; urgency=high + + * Yes, yes. I commented out this line, because I've acpi in + built into my kernel. Enabled it again. (Closes: #232400) + * Fixed some lintian related issues. + + -- Cajus Pollmeier Sun, 15 Feb 2004 09:23:31 +0100 + +acpid (1.0.2-8) unstable; urgency=low + + * Finetuning in init script for automatic module loading (Closes: #232400) + * Added debconf script to help user, made 'load all modules' the + default. + * Unmasked signals so that processes started from acpid can receive + TERM signals. (Closes: #206525) + * Added changes from CVS. New upstream release is comming soon. + + -- Cajus Pollmeier Thu, 12 Feb 2004 18:58:29 +0100 + +acpid (1.0.2-7) unstable; urgency=low + + * Renamed acpid socket. gnome-applet seems to have a compiled + in default for /var/run/acpid.socket. (Closes: #217932) + + -- Cajus Pollmeier Fri, 31 Oct 2003 21:15:17 +0100 + +acpid (1.0.2-6) unstable; urgency=low + + * Fixed module loader in init script. Credits go to Tim Wright. + + -- Cajus Pollmeier Wed, 22 Oct 2003 20:48:17 +0200 + +acpid (1.0.2-5) unstable; urgency=low + + * Ok. Removing socket support was no good idea. Obviously there + are some programms that depend on it. Notice, that the socket + is on a non standard location currently. (Closes: #207926) + + -- Cajus Pollmeier Thu, 9 Oct 2003 07:10:51 +0200 + +acpid (1.0.2-4) unstable; urgency=low + + * Removed socket support for Debian. I currently don't see any use + in it. + * Changed postrm to clean only config files (Closes: #202858) + * Added acpid to logrotate.d (Closes: #200705) + + -- Cajus Pollmeier Fri, 5 Sep 2003 16:51:43 +0200 + +acpid (1.0.2-3) unstable; urgency=low + + * Make --purge remove /etc/acpi directory (Closes: #197981) + + -- Cajus Pollmeier Thu, 19 Jun 2003 08:43:48 +0200 + +acpid (1.0.2-2) unstable; urgency=low + + * Fixed module loading for kernel 2.5. Modules now have .ko as extension + so that the former .o method wouldn't work (Closes: #193709) + + -- Cajus Pollmeier Sun, 18 May 2003 12:06:04 +0200 + +acpid (1.0.2-1) unstable; urgency=low + + * New upstream release + + -- Cajus Pollmeier Wed, 14 May 2003 07:39:25 +0200 + +acpid (1.0.1-8) unstable; urgency=low + + * Fixed automatic module loading script regex (Closes: #192711) + + -- Cajus Pollmeier Sat, 10 May 2003 10:27:14 +0200 + +acpid (1.0.1-7) unstable; urgency=low + + * Changed poweroff script to be dcop aware (Closes: #187493) + * Made title line in control file to make it more meaningly (Closes: #181774) + + -- Cajus Pollmeier Fri, 4 Apr 2003 19:56:34 +0200 + +acpid (1.0.1-6) unstable; urgency=low + + * load modules even when acpi.o is not compiled in kernel (Closes: #173173) + * updated standards-version + + -- Cajus Pollmeier Mon, 30 Dec 2002 13:58:26 +0100 + +acpid (1.0.1-5) unstable; urgency=low + + * added modules autoloading in startup script, see /etc/default/acpid (Closes: #173173) + + -- Cajus Pollmeier Sun, 29 Dec 2002 19:51:32 +0100 + +acpid (1.0.1-4) unstable; urgency=high + + * removed double freed pointer in event.c (Closes: #153288) + + -- Cajus Pollmeier Tue, 20 Aug 2002 08:05:31 +0100 + +acpid (1.0.1-3) unstable; urgency=high + + * forgot do close ia64 bug (Closes: #141101) + * made run-parts stylish /etc/acpi/events (Closes: #141350) + * renamed samples to examples and added joeys examples (Closes: #141351) + + -- Cajus Pollmeier Sat, 6 Apr 2002 10:21:15 +0100 + +acpid (1.0.1-2) unstable; urgency=high + + * Added ia64 for build + + -- Cajus Pollmeier Fri, 5 Apr 2002 08:34:01 +0100 + +acpid (1.0.1-1) unstable; urgency=high + + * new upstream release + * Fixed event handling to fit the new specs - again + + -- Cajus Pollmeier Sat, 9 Mar 2002 12:10:51 +0100 + +acpid (1.0.0-4) unstable; urgency=high + + * Changed priority to optional (Closes: #135578) + * Fixed event handling to fit the new specs + + -- Cajus Pollmeier Sat, 9 Mar 2002 12:10:51 +0100 + +acpid (1.0.0-3) unstable; urgency=high + + * Removed incompatibility message + * Closed bugs that should have been fixed with 1.0.0-2 (Closes: #130934, #127451) + * Fixed event handling with kernels patched with acpi-devel code + * Added reload option to the initscript (Closes: #129425) + + -- Cajus Pollmeier Fri, 1 Mar 2002 15:13:06 +0100 + +acpid (1.0.0-2) unstable; urgency=low + + * Fixed logfile not beeing truncated + * Changed line width of short description to less than 60 characters + * Close bugs not related to this upstream release (Closes: #67465, #108796, #63956, #109559, #110698, #107047) + + -- Cajus Pollmeier Thu, 1 Nov 2001 13:30:16 +0100 + +acpid (1.0.0-1) unstable; urgency=low + + * New upstream release + * Fixed read_line to work with unpatched 2.4.x kernels. + + -- Cajus Pollmeier Mon, 10 Aug 2001 12:12:41 +0200 + +acpid (0.2001051000-1) unstable; urgency=low + + * New upstream release (Closes: #97277, #104266) + * New maintainer + * 'acpictl' is no longer in the acpid package. (Closes: #79498) + * 'acpid' doesn't need build-depends anymore (Closes: #105751) + + -- Robert van der Meulen Mon, 25 Jun 2001 16:01:12 +0200 + +acpid (0.2000071100-1) unstable; urgency=low + + * New upstream release + + -- Wichert Akkerman Wed, 12 Jul 2000 20:57:07 -0400 + +acpid (0.2000052200-1) unstable; urgency=low + + * New upstream release + + -- Wichert Akkerman Tue, 23 May 2000 13:41:51 +0200 + +acpid (0.2000042500-1) unstable; urgency=low + + * New upstream release + * Fix a typo in the init-script + * upstream changed the buildsystem again, updated debian/rules accordingly + * Stop via executable, not pid-file (which doesn't exist) + + -- Wichert Akkerman Mon, 1 May 2000 23:00:46 +0200 + +acpid (0.20000317-2) unstable; urgency=low + + * Create /usr/doc compatibility symlinks + + -- Wichert Akkerman Fri, 7 Apr 2000 14:26:31 +0200 + +acpid (0.20000317-1) experimental; urgency=low + + * New snapshot + + -- Wichert Akkerman Mon, 3 Apr 2000 00:50:17 +0200 + +acpid (0.20000316-1) experimental; urgency=low + + * Initial release + + -- Wichert Akkerman Thu, 16 Mar 2000 12:24:51 +0100 + --- acpid-1.0.4.orig/debian/powerbtn +++ acpid-1.0.4/debian/powerbtn @@ -0,0 +1,13 @@ +# /etc/acpi/events/powerbtn +# This is called when the user presses the power button and calls +# /etc/acpi/powerbtn.sh for further processing. + +# Optionally you can specify the placeholder %e. It will pass +# through the whole kernel event message to the program you've +# specified. + +# We need to react on "button power.*" and "button/power.*" because +# of kernel changes. + +event=button[ /]power +action=/etc/acpi/powerbtn.sh --- acpid-1.0.4.orig/debian/acpid.init.d +++ acpid-1.0.4/debian/acpid.init.d @@ -0,0 +1,100 @@ +#! /bin/sh -e + +# Check for daemon presence +test -x /usr/sbin/acpid || exit 0 + +# Check for ACPI support on kernel side +[ -d /proc/acpi ] || exit 0 + +# Include acpid defaults if available +OPTIONS="" +if [ -f /etc/default/acpid ] ; then + . /etc/default/acpid +fi + +# Get lsb functions +. /lib/lsb/init-functions +. /etc/default/rcS + +if [ "x$VERBOSE" = "xno" ]; then + MODPROBE_OPTIONS="$MODPROBE_OPTIONS -Q" + export MODPROBE_OPTIONS +fi + +# As the name says. If the kernel supports modules, it'll try to load +# the ones listed in "MODULES". +load_modules() { + PRINTK=`cat /proc/sys/kernel/printk` + [ "$VERBOSE" = no ] && echo "0 0 0 0" > /proc/sys/kernel/printk + + LIST=`/sbin/lsmod|awk '!/Module/ {print $1}'` + + # Get list of available modules + LOC="/lib/modules/`uname -r`/kernel/drivers/acpi" + LOC2="/lib/modules/`uname -r`/kernel/ubuntu/acpi" + if [ -d $LOC ]; then + MODAVAIL=`( find $LOC -type f -name "*.o" -printf "basename %f .o\n"; \ + find $LOC -type f -name "*.ko" -printf "basename %f .ko\n" ) | /bin/sh` + else + MODAVAIL="" + fi + + if [ -d $LOC2 ]; then + MODAVAIL="$MODAVAIL `( find $LOC2 -type f -name "*.o" -printf "basename %f .o\n"; \ + find $LOC2 -type f -name "*.ko" -printf "basename %f .ko\n" ) | /bin/sh`" + fi + + if [ "$MODULES" = "all" ]; then + MODULES="$MODAVAIL" + fi + + if [ -n "$MODULES" ]; then + log_begin_msg "Loading ACPI modules..." + STATUS=0 + for mod in $MODULES; do + echo $MODAVAIL | grep -q -w "$mod" || continue + if echo $LIST | grep -q -w "$mod"; then + [ "$VERBOSE" != no ] && log_success_msg "Module already loaded: $mod" + else + if modprobe -b $mod 2>/dev/null; then + [ "$VERBOSE" != no ] && log_success_msg "Loaded module: $mod" + else + if [ "$VERBOSE" != no ]; then + log_warning_msg "Unable to load module: $mod" + fi + fi + fi + done + log_end_msg $STATUS + fi + echo "$PRINTK" > /proc/sys/kernel/printk +} + +case "$1" in + start) + [ -f /proc/modules ] && load_modules + log_begin_msg "Starting ACPI services..." + start-stop-daemon --start --quiet --oknodo --exec /usr/sbin/acpid -- -c /etc/acpi/events $OPTIONS + log_end_msg $? + ;; + stop) + log_begin_msg "Stopping ACPI services..." + start-stop-daemon --stop --quiet --oknodo --retry 2 --exec /usr/sbin/acpid + log_end_msg $? + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + reload|force-reload) + log_begin_msg "Reloading ACPI services..." + start-stop-daemon --stop --signal 1 --exec /usr/sbin/acpid + log_end_msg $? + ;; + *) + log_success_msg "Usage: /etc/init.d/acpid {start|stop|restart|reload|force-reload}" + exit 1 +esac + +exit 0 --- acpid-1.0.4.orig/debian/copyright +++ acpid-1.0.4/debian/copyright @@ -0,0 +1,14 @@ +This is the Debian GNU/Linux prepackaged version of acpid. +It was packaged by Cajus Pollmeier +from sources obtained from http://acpid.sourceforge.net. + +Copyright: + +Copyright (C) 2000 Andrew Henroid + +License: + +acpid is distributed under the terms of the GNU General Public License, +version 2. On Debian GNU/Linux system you can find a copy of this +license in `/usr/share/common-licenses/GPL'. + --- acpid-1.0.4.orig/debian/acpid.install +++ acpid-1.0.4/debian/acpid.install @@ -0,0 +1,7 @@ +debian/powerbtn etc/acpi/events/ +examples/default usr/share/doc/acpid/examples/ +examples/default.sh usr/share/doc/acpid/examples/ +examples/ac usr/share/doc/acpid/examples/ +examples/ac.sh usr/share/doc/acpid/examples/ +acpi_listen usr/bin +acpid usr/sbin --- acpid-1.0.4.orig/debian/acpid.logrotate +++ acpid-1.0.4/debian/acpid.logrotate @@ -0,0 +1,9 @@ +/var/log/acpid { + weekly + rotate 4 + compress + missingok + postrotate + pkill -SIGUSR1 acpid > /dev/null + endscript +} --- acpid-1.0.4.orig/debian/README.debian +++ acpid-1.0.4/debian/README.debian @@ -0,0 +1,39 @@ +acpid for Debian +================ + +Kernel requirements: +- Unpatched 2.4.x where x >= 7 +- Unpatched 2.5.x should work, not tested +- Using acpi patches from http://sourceforge.net/project/acpi. The newest is your friend. + +General: +The acpid daemon now handles user defined events, too. Place event files +under /etc/acpi/events. + +If an event occurs, acpid recurses through the event files in order to +see if the regex defined after "event" matches. If they do, action is +executed. + +Example: /etc/acpi/events/power + +# This file handles the actions for the power button +event=button power.* +action=/sbin/init 0 + +# This is the new style, introduced by the acpi patch acpi-20020329. +#event=button/power .* +#action=/sbin/init 0 + +NOTE: This has changed in acpi development code! See /etc/acpi/default.sh + for more information. + +Your script will get the complete event string (as reported by +/proc/acpid/events), if you use %e as a parameter of your script. +You may want to split this by calling set $*. $1 then holds the +event group, $2 takes the event and $3 and $4 take the values as +reported by the kernel. + +When using acpid with modules, you can use /etc/default/acpid in order +to specify modules to be loaded at startup. + +Cajus Pollmeier , Fri, 08 Sept 2001 11:58:48 +0200 --- acpid-1.0.4.orig/debian/compat +++ acpid-1.0.4/debian/compat @@ -0,0 +1 @@ +4 --- acpid-1.0.4.orig/debian/acpid.manpages +++ acpid-1.0.4/debian/acpid.manpages @@ -0,0 +1,2 @@ +acpid.8 +acpi_listen.8 --- acpid-1.0.4.orig/event.c +++ acpid-1.0.4/event.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -79,19 +80,6 @@ static char *parse_cmd(const char *cmd, const char *event); static int check_escapes(const char *str); -/* helper */ -static int -path_is_dir(const char *path) -{ - struct stat s; - - if (stat(path, &s)) { - acpid_log("ERR: stat(\"%s\"): %s\n", path, strerror(errno)); - return 0; - } - return S_ISDIR(s.st_mode); -} - /* * read in all the configuration files */ @@ -102,6 +90,8 @@ struct dirent *dirent; char *file = NULL; int nrules = 0; + char *basen = NULL; + regex_t preg; lock_rules(); @@ -117,6 +107,7 @@ while ((dirent = readdir(dir))) { int len; struct rule *r; + struct stat stat_buf; if (dirent->d_name[0] == '.') continue; /* skip dotfiles */ @@ -130,15 +121,31 @@ } snprintf(file, len, "%s/%s", confdir, dirent->d_name); - if (path_is_dir(file)) { + /* allow only regular files and symlinks to these */ + if (stat(file, &stat_buf) != 0) { + acpid_log("ERR: stat(%s): %s\n", file, strerror(errno)); + unlock_rules(); + return -1; + } + if (!S_ISREG(stat_buf.st_mode)) { + acpid_log("DBG: skipping non-file %s\n", file); free(file); - continue; /* skip subdirs */ + continue; } - r = parse_file(file); - if (r) { - enlist_rule(&cmd_list, r); - nrules++; + /* check for run-parts style filename */ + basen = basename(file); + if (regcomp(&preg, "^[a-zA-Z0-9_-]+$", RULE_REGEX_FLAGS) == 0){ + if (regexec(&preg, basen, 0, NULL, 0) == 0){ + r = parse_file(file); + if (r) { + enlist_rule(&cmd_list, r); + nrules++; + } + } else { + acpid_log("DBG: ignoring conf file %s\n", file); + } + } free(file); } @@ -223,7 +230,7 @@ } /* read each line */ - while (!feof(fp)) { + while (!feof(fp) && !ferror(fp)) { char *p = buf; char key[64]; char val[512]; @@ -589,6 +596,8 @@ /* closed */ acpid_log("client has disconnected\n"); delist_rule(&client_list, rule); + close(rule->action.fd); + free_rule(rule); return -1; } safe_write(client, "\n", 1); --- acpid-1.0.4.orig/acpid.c +++ acpid-1.0.4/acpid.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -41,6 +42,7 @@ static int daemonize(void); static int open_logs(void); static void clean_exit(int sig); +static void reopen_logs(int sig); static void reload_conf(int sig); static char *read_line(int fd); @@ -52,6 +54,8 @@ static const char *logfile = ACPI_LOGFILE; static const char *eventfile = ACPI_EVENTFILE; static const char *socketfile = ACPI_SOCKETFILE; +static const char *lockfile = ACPI_LOCKFILE; +static const char *logfilegroup = ACPI_LOGFILE_GROUP; static int nosocket; static const char *socketgroup; static mode_t socketmode = ACPI_SOCKETMODE; @@ -61,7 +65,7 @@ main(int argc, char **argv) { int event_fd; - int sock_fd; + int sock_fd=-1; /* learn who we really are */ progname = (const char *)strrchr(argv[0], '/'); @@ -162,6 +166,7 @@ /* trap key signals */ signal(SIGHUP, reload_conf); + signal(SIGUSR1, reopen_logs); signal(SIGINT, clean_exit); signal(SIGQUIT, clean_exit); signal(SIGTERM, clean_exit); @@ -193,8 +198,13 @@ /* was it an event? */ if (ar[0].revents) { char *event; - - /* this shouldn't happen */ + struct stat trash; + int fexists; + + /* Check for the existence of a lockfile */ + fexists = stat(lockfile, &trash); + + /* this shouldn't happen */ if (!ar[0].revents & POLLIN) { acpid_log("odd, poll set flags 0x%x\n", ar[0].revents); @@ -203,6 +213,14 @@ /* read and handle an event */ event = read_line(event_fd); + + /* we're locked, don't process the event */ + if (fexists == 0) { + acpid_log("Lock file present, not processing event\n"); + continue; + } + + if (event) { acpid_log("received event \"%s\"\n", event); acpid_handle_event(event); @@ -269,6 +287,8 @@ {"nosocket", 1, 0, 'S'}, {"version", 0, 0, 'v'}, {"help", 0, 0, 'h'}, + {"lockfile", 1, 0, 'L'}, + {"logfilegroup", 1, 0, 'G'}, {NULL, 0, 0, 0}, }; const char *opts_help[] = { @@ -283,6 +303,8 @@ "Do not listen on a UNIX socket (overrides -s).",/* nosocket */ "Print version information.", /* version */ "Print this message.", /* help */ + "Use the specified file to lock the daemon.", /* lockfile */ + "Set the group on the log file.", /* logfilegroup */ }; struct option *opt; const char **hlp; @@ -290,7 +312,7 @@ for (;;) { int i; - i = getopt_long(*argc, *argv, "c:de:fg:l:m:s:Svh", opts, NULL); + i = getopt_long(*argc, *argv, "c:de:fg:l:m:s:SvhL:", opts, NULL); if (i == -1) { break; } @@ -326,6 +348,12 @@ case 'v': printf(PACKAGE "-" VERSION "\n"); exit(EXIT_SUCCESS); + case 'L': + lockfile = optarg; + break; + case 'G': + logfilegroup = optarg; + break; case 'h': default: fprintf(stderr, "Usage: %s [OPTIONS]\n", progname); @@ -396,7 +424,8 @@ { int logfd; int nullfd; - + struct group *logfile_grp = getgrnam(logfilegroup); + /* set up stdout, stderr to log and stdin to /dev/null */ nullfd = open("/dev/null", O_RDONLY, 0640); if (nullfd < 0) { @@ -410,7 +439,13 @@ logfile, strerror(errno)); return -1; } - + if (logfile_grp != NULL) { + if (fchown(logfd, -1, logfile_grp->gr_gid) == -1) { + fprintf(stderr, "%s: fchown: %s", progname, + strerror(errno)); + return -1; + } + } if (dup2(nullfd, STDIN_FILENO) != STDIN_FILENO) { fprintf(stderr, "%s: dup2: %s\n", progname, strerror(errno)); return -1; @@ -446,6 +481,18 @@ acpid_read_conf(confdir); } +static void +reopen_logs(int sig) +{ + /* normal logging unless debugging */ + if (!acpid_debug) { + if (open_logs() < 0) + exit(EXIT_FAILURE); + } + + acpid_log("logfile reopened\n"); +} + int acpid_log(const char *fmt, ...) { --- acpid-1.0.4.orig/acpid.8 +++ acpid-1.0.4/acpid.8 @@ -15,7 +15,10 @@ .PP \fIRules\fP are defined by simple configuration files. \fBacpid\fP will look in a configuration directory (\fI/etc/acpi/events\fP by default), -and parse all files that do not begin with a period ('.'). Each file must +and parse all files that fit to a runparts style naming convetion. This means +that files containing a dot and contain characters different from a-z and 0-9 +would be ignored. Debian implementation differs at this point from standard +acpid. Each file must define two things: an \fIevent\fP and an \fIaction\fP. Any blank lines, or lines where the first character is a pound sign ('#') are ignored. Extraneous lines are flagged as warnings, but are not fatal. Each line has three tokens: