--- powernap-2.4.orig/debian/rules +++ powernap-2.4/debian/rules @@ -0,0 +1,46 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +# export DH_VERBOSE=1 + +PKG=powernap +VER=`head -n 1 debian/changelog | sed 's/^.*(//' | sed 's/).*//' | sed 's/-.*//'` + +get-orig-source: + dh_testdir + bzr export ../${PKG}_${VER}.orig.tar.gz + +clean: + dh_clean + +build: + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_install -X.bzr + +binary-indep: build install + dh_testdir -i + dh_testroot -i + dh_installdocs -X.bzr -i + dh_installman -i + dh_lintian + dh_installchangelogs -i + dh_installdebconf -i + dh_installlogrotate --package=${PKG} --name=${PKG} + dh_installinit --error-handler=true + dh_compress -i + dh_fixperms -i + DH_PYCENTRAL="include-links" dh_pycentral -i + dh_installdeb -i + dh_gencontrol -i + dh_md5sums -i + dh_builddeb -i + +binary: binary-indep +.PHONY: build clean binary-indep binary install get-orig-source + +binary-arch: --- powernap-2.4.orig/debian/powerwake.postrm +++ powernap-2.4/debian/powerwake.postrm @@ -0,0 +1,9 @@ +#!/bin/sh -e + +PKG="powerwake" + +if [ "$1" = remove ]; then + rm -rf /var/cache/$PKG +fi + +#DEBHELPER# --- powernap-2.4.orig/debian/powerwake.postinst +++ powernap-2.4/debian/powerwake.postinst @@ -0,0 +1,13 @@ +#!/bin/sh -e + +PKG="powerwake" + +if [ "$1" = configure ] || [ "$1" = reconfigure ]; then + getent group admin > /dev/null 2>&1 || addgroup --system --quiet admin + mkdir -p /var/cache/$PKG + touch /var/cache/$PKG/ethers + chown root:admin /var/cache/$PKG/ethers + chmod 664 /var/cache/$PKG/ethers +fi + +#DEBHELPER# --- powernap-2.4.orig/debian/powernap.manpages +++ powernap-2.4/debian/powernap.manpages @@ -0,0 +1,6 @@ +man/powernap.8 +man/powernapd.8 +man/powernap-now.8 +man/powerwake-now.8 +man/powernap-action.8 +man/powernap_calculator.1 --- powernap-2.4.orig/debian/control +++ powernap-2.4/debian/control @@ -0,0 +1,58 @@ +Source: powernap +Section: admin +Priority: optional +Maintainer: Dustin Kirkland +Standards-Version: 3.9.1 +Build-Depends: debhelper (>= 6), gettext-base, python-central (>= 0.5), python +XS-Python-Version: current +Homepage: http://launchpad.net/powernap +Vcs-Bzr: http://bazaar.launchpad.net/~kirkland/powernap/trunk + +Package: powernap +Architecture: all +XB-Python-Version: ${python:Versions} +Depends: ${misc:Depends}, ${python:Depends}, debconf (>= 0.5) | debconf-2.0, + pm-utils, powernap-common (= ${binary:Version}) +Recommends: ethtool +Enhances: powerwake +Description: reduce the power consumption of a system when inactive + PowerNap watches a series of configurable monitors. When no activity + has occurred on any of these monitors for some specified time, PowerNap + deems the system inactive, and takes action, as configured by the system + administrator. + . + PowerNap can monitor: + * User Activity (Console, Keyboard, Mouse) + * System Activity (Load, Processes, Process IO) + * Network Activity (wake-on-lan, UDP ports, TCP ports) + . + Some of these are event-based, while others are poll-based. PowerNap's + polling interval, INTERVAL_SECONDS, is configurable. + . + The required length of inactivity, ABSENT_SECONDS, is configurable. + . + The action taken by PowerNap when the system is active, is configurable, + and might be one of pm-powersave, pm-suspend, pm-hibernate, poweroff, + or any executable script as chosen by the system administrator. + . + See /etc/powernap/config for all configurable options and defaults. + +Package: powernap-common +Architecture: all +XB-Python-Version: ${python:Versions} +Depends: ${misc:Depends}, ${python:Depends}, debconf (>= 0.5) | debconf-2.0 +Description: common library files required by powernap + This package contains the common library files required as a runtime + dependency of powernap. + +Package: powerwake +Architecture: all +XB-Python-Version: ${python:Versions} +Depends: ${misc:Depends}, ${python:Depends}, debconf (>= 0.5) | debconf-2.0 +Enhances: powernap +Description: remotely wake a napping system + PowerWake is a generic mechanism for remotely waking systems. It is + intended to support wake-on-lan, ipmi, and other remote waking mechanisms. + Currently, wake-on-lan is the only supported mechanism. It also includes + some handy caching of MAC addresses, such that systems can be awakened by + hostname or ip address, in addition to MAC address. --- powernap-2.4.orig/debian/compat +++ powernap-2.4/debian/compat @@ -0,0 +1 @@ +6 --- powernap-2.4.orig/debian/changelog +++ powernap-2.4/debian/changelog @@ -0,0 +1,298 @@ +powernap (2.4-0ubuntu1) natty; urgency=low + + [ Andres Rodriguez ] + * Fix wall message timestamp (LP: #718242) + * Add powerwake-now support. Sends signal to powernapd to wakeup + powersave mode if the daemon is in powersave. + * debian/powernap.upstart: Add pre-stop. + - Issues 'powerwake-now' to wake up system if stopping while in powersave. + - Add 'sleep 3' to wait for recover action to take place before actually + stopping powernapd. Otherwise, it won't recover. + * bin/powernapd: Set flags back to initial values if GRACE PERIOD completed. + Ensures that flags have correct values if powerwake-now signal was received. + + [ Dustin Kirkland ] + * sbin/powernapd: only display wall message if action is other than + powersave + + -- Andres Rodriguez Wed, 16 Feb 2011 12:26:14 -0500 + +powernap (2.3-0ubuntu1) natty; urgency=low + + [ Andres Rodriguez ] + * config,sbin/powernapd,powernap/powernap.py: New option to decide if + powernapd will WARN the user via a wall message. Default yes. + * sbin/powernapd: Use a Timestamp when sending the wall message. + * InputMonitor now only enables/disables keyboard and mouse monitoring. + - powernap/monitors/InputMonitor.py: Match regex in /by-id for kbd. + - powernap/powernap.py: Support only mouse/keyboard + - config: Only add options for mouse/keyboard. + * Enabled InputMonitors by default. + - config: Enable. + - powernap.py: Only try to initialize if "mouse" or "kbd" are connected + by looking into /dev/input/by-id. + * powernapd: Add SIGIO handler. Ignores failure caused when disconnecting + a monitored USB InputDevice, that caused powernapd to stop running. + + [ Dustin Kirkland ] + * man/powernap-action.8, man/powernap_calculator.1: fix lintian warnings, + escpae hyphens + * debian/control: update package descriptions + + -- Dustin Kirkland Tue, 08 Feb 2011 23:10:40 -0600 + +powernap (2.2-0ubuntu1) natty; urgency=low + + [ Andres Rodriguez ] + * actions: + - cpu_smp_sched,eth_wol: Dropped. pm-utils provides its own verion. + - cpu_frequency: Store default governor to reset it to default value. + * debian/rules: run dh_installdeb *after* dh_pycentral. + * Add lintian-overrides (LP: #706974) + * sbin/powernap: Fix pm-powersave command path. + + -- Dustin Kirkland Fri, 28 Jan 2011 10:46:38 -0600 + +powernap (2.1-0ubuntu1) natty; urgency=low + + [ Andres Rodriguez ] + * config: + - Default ACTION to pm-powersave instead of best-effort. + - Enable WoLMonitor and ConsoleMonitor by default + - Disable ProcessMonitor by default. + - Change powersave defaults to 0 instead of 4. Update related files. + * powernap/monitors: + - Rename RemoteMonitor to UDPMonitor. + - Add WoLMonitor and support to run it. + - Add ConsoleMonitor and support to run it. + * powernap/powernap.py: + - Improve config loading method for Monitors. + * sbin/powernapd: Change approach of powernapd_loop. + - GRACE period is time between ABSENT_SECONDS and + (ABSENT_SECONDS - GRACE_SECONDS) + - Only send a Wall message when on GRACE Period. + - Enable Monitors to run at all times. Specifically when in PowerSave. + * man/powernapd.8: Update to list available Monitors with description. + * Update Copyright years/email in some of the files. + + [ Dustin Kirkland ] + * config, powernap/monitors/TCPMonitor.py, powernap/powernap.py: + - add a TCP Monitor + * config, powernap/monitors/LoadMonitor.py, powernap/powernap.py: + - add a system Load Monitor + * debian/control: bump standards version + * debian/rules: make sure powernapd starts on install, LP: #705959 + * config: update service restart method + + -- Dustin Kirkland Thu, 27 Jan 2011 16:38:22 -0600 + +powernap (2.0-0ubuntu1) natty; urgency=low + + [ Andres Rodriguez ] + * powernap/monitors: Re-work Monitors to integrate them with PowerNap. + * powernap/powernap.py: Minor fixes to not crash when loading monitors. + * sbin/powernapd: Integrate Monitors approach to work with Daemon. + * Update copyright headers for some files + * Update manpages and add one for powernap-action. + * Update packaging: + - debian/control: Add python related fileds. + - debian/rules: Add dh_pycentral related rules. + * Add new package to contain new modules and monitors: + - debian/control: Add package powernap-common. + - debian/powernap-common.install: Install new files (PowerNap class and + Monitors); Move action scripts installation to this package. + * sbin/powernapd: Improve WoL monitor to listen in eth* interfaces. + * config: Update and cleanup. + * sbin/powernapd,bin/powerwake: Fix generation of WoL Magic Packet. + Apparently, more data than required was addeed. (LP: #705943) + + -- Dustin Kirkland Sat, 22 Jan 2011 09:09:04 -0600 + +powernap (1.12-0ubuntu1) natty; urgency=low + + [ Andres Rodriguez ] + * Revert Adam changes to some files (rev148 - Original PowerNap behavior) + - powernapd, powernapd.8, action, config. + * Re-organize the source and update the packaging: + - sbin: Moved powernap, powernapd, powernapd-now. + - bin: Moved powerwake, powernap_calculator. + - man: Moved manpages here. + - debian/{powernap,powerwake}.install: Update accordingly. + - debian/{powernap,powerwake}.manpages: Update accordingly. + - powernap/monitors: Moved Adam's Monitors. + * Add new powersave method, using pm-powersave: + - actions/: Add a set of scripts to reduce power consumption + - powernap-action: Add tool to enable/disable and list powersave actions. + - debian/powernap.install: Install new files. + * Provide ability to select a PowerNap method to perform. + - config: Add config variable to select method. + - powernap/{powernap,powernapd}: Make necessary changes. + * Add WoL monitor to 'wake up' for when 'pm-powersave' action is taken. + - sbin/powernapd: Add WoL Monitor. + - sbin/powerna: Take pm-powersave action correctly. + * Add class to handle config: + - powernap/powernap.py: Add class that handles config and initialization + of different monitors + + -- Dustin Kirkland Tue, 11 Jan 2011 12:59:13 -0600 + +powernap (1.11-0ubuntu1) natty; urgency=low + + [ Adam Sutton ] + * reworked config file and config file parsing + * modularized the monitoring to a set of logical plugins + * added a monitor on a UDP port for staying awake + + [ Nobuto MURATA ] + * powerwake_completion: add bash completion from $HOME/.cache/ethers, + LP: #675445 + * debian/powernap.upstart: fix LP: #598241 cannot enable Wake-on-LAN + when ifconfig output is translated + + [ Dustin Kirkland ] + * powerwake: test if home dir is writable (might not be, eg: www-data) + + -- Dustin Kirkland Wed, 17 Nov 2010 17:15:25 -0600 + +powernap (1.10-0ubuntu1) maverick; urgency=low + + [ Nobuto MURATA ] + * debian/powerwake.install, powerwake_completion: add bash completion + for powerwake, LP: #551073 + + [ Dustin Kirkland ] + * powerwake: create the ~/.cache/ethers file, if it does not already + exist, LP: #582381 + + -- Dustin Kirkland Tue, 18 May 2010 12:33:32 -0500 + +powernap (1.9-0ubuntu1) lucid; urgency=low + + * debian/powernap.upstart: fix LP: #531950 + - fix ethtool regex + - allow for admin customized ethtool script, when powernap's + is incorrect or undesired + + -- Dustin Kirkland Thu, 04 Mar 2010 11:04:49 -0600 + +powernap (1.8-0ubuntu1) lucid; urgency=low + + * powerwake: + - test ethers file for writability, LP: #458163 + - since non-priv users cannot write to globally cached ethers, support + local user eth caches + * powernap-now, debian/install: + - add a powernap-now utility, for sending the 'now' + signal to the daemon + * debian/powernap.manpages, powernap-now.8: + - add powernap-now manpages + * debian/powernap.init, debian/powernap.upstart, debian/rules: + - upstart-ify powernap + + -- Dustin Kirkland Sat, 06 Feb 2010 22:34:34 -0600 + +powernap (1.7-0ubuntu1) karmic; urgency=low + + * debian/powernap.init: enable WoL at boot on interface(s) that support + wake-on-lan, to ensure that a powernapping system can be awoken + later, LP: #445950 + + -- Dustin Kirkland Wed, 19 Aug 2009 00:19:13 -0500 + +powernap (1.6-0ubuntu1) karmic; urgency=low + + [ Dan Nurmi ] + * powerwake: add support for a broadcast argument, add getopt support + + [ Dustin Kirkland ] + * powerwake.1: updated to handle Dan's extensions and new arguments + * powernap_calculator, powernap_calculator.1: new script to help determine + the expected power savings usings powernap in a cloud environment; + manpage documentation added + * debian/powernap.logrotate: rotate the powernap log + * powernapd: overhaul powernap's logging using python's built-in logging + functionality + * debian/control: bump standards version + + -- Dustin Kirkland Tue, 18 Aug 2009 19:12:43 -0500 + +powernap (1.5-0ubuntu1) karmic; urgency=low + + * powerwake: handle more gracefully the lack of an /etc/ethers file + * powernapd: fix timestamp + + -- Dustin Kirkland Fri, 10 Jul 2009 17:37:54 -0500 + +powernap (1.4-0ubuntu1) karmic; urgency=low + + * powerwake: maintain and use a cache of mac addresses, in + /var/cache/powerwake/ethers; test is_mac() before adding to arp hash + * debian/powerwake.dirs, debian/powerwake.install, + debian/powerwake.postinst, debian/control: add a separate powerwake + package + * debian/manpages, debian/powerwake.manpages: added manpage debhelper + files + * debian/control: recommend ethtool, which might be necessary to enable + wake-on-lan on your ethernet card, powernap depends on pm-utils + * powernap -> powernapd, debian/init, debian/install: rename the python + powernap daemon 'powernapd' + * powernap.1 -> powernapd.8: renamed, note ethtool + * powernap: new script that will either take a specified action, or + run one of (pm-suspend, pm-hibernate, poweroff) + * powernap.8: document new script + * action: conffile describing what should go there + * debian/init: drop stdout on 'now' status check + * debian/*: use powernap.* and powerwake.* to remove any ambiguity + * powernapd: look for activity on /dev/* consoles and in /proc/interrupts + during the grace period, such that any activity will cancel the + powernap operation + * powerwake, powerwake.1: update to allow for static configuration + override in /etc/ethers + + -- Dustin Kirkland Thu, 09 Jul 2009 17:28:44 -0500 + +powernap (1.3-0ubuntu1) karmic; urgency=low + + * config: add default value statement to each item; add sane defaults; + add grace period section + * powernap: add a system-wide warning message using 'wall', and a grace + seconds interval to cancel the operation of 60 seconds (by default); + move to using global variables for options defined in the config file + * debian/control: depend on bsdutils for 'wall' utility + + -- Dustin Kirkland Mon, 29 Jun 2009 14:49:55 -0700 + +powernap (1.2-0ubuntu1) karmic; urgency=low + + * config, debian/control, powernap.1, powernap.py: lower the default + polling period from 10 seconds to 1 second; polling /proc is cheap, + and empirical testing has shown a negligible performance impact; + add a note about DEBUG + * powernap.py -> powernap: + - abstract take_action() to a function, add a handler for --now + - daemonize within the python script + - eliminate the shell wrapper + - log to /var/log/powernap.* + - add signal handling for "now", USR1 + * powernap.1: add log files + * debian/init: add 'now' action and signal passing + * powerwake: initial cut at powerwake utility + * powerwake.1: initial cut at powerwake documentation + + -- Dustin Kirkland Fri, 26 Jun 2009 17:23:22 -0500 + +powernap (1.1-0ubuntu1) karmic; urgency=low + + * debian/copyright: updated for Ubuntu inclusion + + -- Dustin Kirkland Fri, 12 Jun 2009 12:53:54 -0500 + +powernap (1.0-0ubuntu1) karmic; urgency=low + + [ Initial release ] + * powernap: shell wrapper script + * powernap.py: python daemon + * config: global configuration file + * powernap.1: manpage documentation + + -- Dustin Kirkland Thu, 11 Jun 2009 17:30:16 -0500 --- powernap-2.4.orig/debian/powerwake.install +++ powernap-2.4/debian/powerwake.install @@ -0,0 +1,2 @@ +bin/powerwake usr/bin +powerwake_completion etc/bash_completion.d --- powernap-2.4.orig/debian/powernap-common.lintian-overrides +++ powernap-2.4/debian/powernap-common.lintian-overrides @@ -0,0 +1 @@ +powernap-common binary: script-not-executable --- powernap-2.4.orig/debian/copyright +++ powernap-2.4/debian/copyright @@ -0,0 +1,34 @@ +This package was debianized by Dustin Kirkland +Mon, 8 Jun 2009 12:11:37 -0600 + +It was downloaded from: http://launchpad.net/powernap + +Upstream Authors: + Dustin Kirkland + +Copyright: + Copyright (C) 2009 Canonical Ltd. + + All rights reserved. + +License: + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation version 3 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + On Debian systems, the complete text of the GNU General Public + License, version 3, can be found in /usr/share/common-licenses/GPL-3. + +The Ubuntu packaging: + Copyright (C) 2009 Canonical Ltd. + Copyright (C) 2009 Dustin Kirkland + released under the GPL-3. --- powernap-2.4.orig/debian/release.sh +++ powernap-2.4/debian/release.sh @@ -0,0 +1,38 @@ +#!/bin/sh -e + +PKG="powernap" +MAJOR=1 + +error() { + echo "ERROR: $@" + exit 1 +} + +head -n1 debian/changelog | grep "unreleased" || error "This version must be 'unreleased'" + +./debian/rules get-orig-source +bzr bd +sed -i "s/) unreleased;/-0ubuntu1) karmic;/" debian/changelog +bzr bd --builder "debuild -S -sa" --source +minor=`head -n1 debian/changelog | sed "s/^.*($MAJOR.//" | sed "s/-.*$//"` +dch --release +debcommit --release +newminor=`expr $minor + 1` +dch -v "$MAJOR.$newminor" "UNRELEASED" +sed -i "s/$MAJOR.$newminor) .*;/$MAJOR.$newminor) unreleased;/" debian/changelog + +gpg --armor --sign --detach-sig ../"$PKG"_*.orig.tar.gz + +echo +echo +echo "To test:" +echo " sudo dpkg -i ../*.deb" +echo +echo "To commit and push:" +echo " bzr cdiff" +echo " bzr commit -m 'releasing $MAJOR.$minor, opening $MAJOR.$newminor' && bzr push lp:$PKG" +echo +echo "Publish tarball at:" +echo " https://launchpad.net/$PKG/trunk/+addrelease" +echo +echo --- powernap-2.4.orig/debian/powerwake.dirs +++ powernap-2.4/debian/powerwake.dirs @@ -0,0 +1 @@ +/var/cache/powerwake --- powernap-2.4.orig/debian/powernap.install +++ powernap-2.4/debian/powernap.install @@ -0,0 +1,8 @@ +sbin/powernap usr/sbin +sbin/powernapd usr/sbin +sbin/powernap-now usr/sbin +sbin/powerwake-now usr/sbin +sbin/powernap-action usr/sbin +bin/powernap_calculator usr/bin +config etc/powernap +action etc/powernap --- powernap-2.4.orig/debian/powernap.logrotate +++ powernap-2.4/debian/powernap.logrotate @@ -0,0 +1,7 @@ +/var/log/powernap.log /var/log/powernap.err { + rotate 5 + daily + compress + copytruncate + missingok +} --- powernap-2.4.orig/debian/powerwake.manpages +++ powernap-2.4/debian/powerwake.manpages @@ -0,0 +1 @@ +man/powerwake.1 --- powernap-2.4.orig/debian/powernap.upstart +++ powernap-2.4/debian/powernap.upstart @@ -0,0 +1,29 @@ +# powernap + +description "PowerNap" +author "Dustin Kirkland " + +start on runlevel [2345] + +expect daemon + +pre-start script + if [ -x /etc/powernap/ethtool-command ]; then + # Allow for admin-customized ethtool commands here + /etc/powernap/ethtool-command + else + # Otherwise, try to enable Wake-on-LAN on valid interface(s) + for i in $(LANG=C /sbin/ifconfig | grep "encap:Ethernet" | awk '{print $1}'); do + if /usr/sbin/ethtool $i | grep -qs "Supports Wake-on: .*g"; then + /usr/sbin/ethtool -s $i wol g + fi + done + fi +end script + +pre-stop script + powerwake-now || true + sleep 3 +end script + +exec /usr/sbin/powernapd --- powernap-2.4.orig/debian/powernap-common.install +++ powernap-2.4/debian/powernap-common.install @@ -0,0 +1,2 @@ +actions/* etc/pm/power.d +powernap usr/share/pyshared --- powernap-2.4.orig/debian/powernap.lintian-overrides +++ powernap-2.4/debian/powernap.lintian-overrides @@ -0,0 +1 @@ +powernap binary: script-not-executable