--- powernap-1.9.orig/debian/powernap.install +++ powernap-1.9/debian/powernap.install @@ -0,0 +1,6 @@ +powernap usr/sbin +powernapd usr/sbin +powernap-now usr/sbin +powernap_calculator usr/bin +config etc/powernap +action etc/powernap --- powernap-1.9.orig/debian/powerwake.install +++ powernap-1.9/debian/powerwake.install @@ -0,0 +1 @@ +powerwake usr/bin --- powernap-1.9.orig/debian/compat +++ powernap-1.9/debian/compat @@ -0,0 +1 @@ +6 --- powernap-1.9.orig/debian/powernap.upstart +++ powernap-1.9/debian/powernap.upstart @@ -0,0 +1,24 @@ +# 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 $(/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 + +exec /usr/sbin/powernapd --- powernap-1.9.orig/debian/powerwake.dirs +++ powernap-1.9/debian/powerwake.dirs @@ -0,0 +1 @@ +/var/cache/powerwake --- powernap-1.9.orig/debian/rules +++ powernap-1.9/debian/rules @@ -0,0 +1,44 @@ +#!/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_installchangelogs -i + dh_installdebconf -i + dh_installlogrotate --package=${PKG} --name=${PKG} + dh_installinit --noscripts --error-handler=true + dh_compress -i + dh_fixperms -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-1.9.orig/debian/release.sh +++ powernap-1.9/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-1.9.orig/debian/powernap.logrotate +++ powernap-1.9/debian/powernap.logrotate @@ -0,0 +1,7 @@ +/var/log/powernap.log /var/log/powernap.err { + rotate 5 + daily + compress + copytruncate + missingok +} --- powernap-1.9.orig/debian/changelog +++ powernap-1.9/debian/changelog @@ -0,0 +1,130 @@ +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 Sat, 06 Feb 2010 22:34:43 -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-1.9.orig/debian/powerwake.postinst +++ powernap-1.9/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-1.9.orig/debian/powerwake.manpages +++ powernap-1.9/debian/powerwake.manpages @@ -0,0 +1 @@ +powerwake.1 --- powernap-1.9.orig/debian/powernap.manpages +++ powernap-1.9/debian/powernap.manpages @@ -0,0 +1,4 @@ +powernap.8 +powernapd.8 +powernap-now.8 +powernap_calculator.1 --- powernap-1.9.orig/debian/powerwake.postrm +++ powernap-1.9/debian/powerwake.postrm @@ -0,0 +1,9 @@ +#!/bin/sh -e + +PKG="powerwake" + +if [ "$1" = remove ]; then + rm -rf /var/cache/$PKG +fi + +#DEBHELPER# --- powernap-1.9.orig/debian/copyright +++ powernap-1.9/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-1.9.orig/debian/control +++ powernap-1.9/debian/control @@ -0,0 +1,38 @@ +Source: powernap +Section: admin +Priority: optional +Maintainer: Dustin Kirkland +Standards-Version: 3.8.3 +Build-Depends: debhelper (>= 6), gettext-base +Homepage: http://launchpad.net/powernap +Vcs-Bzr: http://bazaar.launchpad.net/~kirkland/powernap/trunk + +Package: powernap +Architecture: all +Depends: ${misc:Depends}, debconf (>= 0.5) | debconf-2.0, python, pm-utils +Recommends: ethtool +Enhances: powerwake +Description: run a defined action if not running some particular processes + PowerNap will run an administrator-specified ACTION when none of a list of + MONITORED_PROCESSES have executed for some number of ABSENT_SECONDS, + checking the process table every INTERVAL_SECONDS. + . + PowerNap can be used to bring a running system to a lower power state when + none of a list of critical processes have run for some amount of time. It + can act as sort of a "screensaver" for servers, watching the process table + for activity rather than the keyboard or mouse. + . + For instance, PowerNap can automatically "pm-suspend" a system if no instance + of "kvm" runs for some contiguous block of "300" seconds, checking the process + table every "1" second. + +Package: powerwake +Architecture: all +Depends: ${misc:Depends}, debconf (>= 0.5) | debconf-2.0, python +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.