debian/0000755000000000000000000000000012260241533007164 5ustar debian/nut-server.postinst0000644000000000000000000000434212260230776013115 0ustar #!/bin/sh -e case "$1" in configure) # make sure the nut user exists and has correct memberships if ! getent group nut >/dev/null; then addgroup --quiet --system nut fi if ! getent passwd nut >/dev/null; then adduser --quiet --system --ingroup nut --home /var/lib/nut --no-create-home nut elif ! groups nut | grep -qw nut; then adduser nut nut fi # for Ubuntu, while waiting for a proper debconf if ! groups nut | grep -qw dialout; then adduser nut dialout fi # make sure that conffiles are secured and have the correct ownerships # on first install if [ -z "$2" ] ; then if [ -d /etc/nut/ ] ; then chown root:nut /etc/nut/ fi for file in ups.conf upsd.conf upsd.users ; do if [ -f /etc/nut/$file ] ; then chown root:nut /etc/nut/$file chmod 640 /etc/nut/$file fi done fi # make sure that /var/run/nut exists and has the correct ownerships if [ ! -d /var/run/nut ] ; then mkdir -p /var/run/nut fi if [ -d /var/run/nut ] ; then chown root:nut /var/run/nut chmod 770 /var/run/nut if which restorecon >/dev/null 2>&1; then restorecon /var/run/nut fi fi # make sure that /var/lib/nut has the correct permissions and ownerships if [ -d /var/lib/nut ] ; then chown root:nut /var/lib/nut chmod 770 /var/lib/nut fi # ask udev to check for new udev rules [ -x /etc/init.d/udev ] && pidof udevd > /dev/null \ && udevadm trigger --subsystem-match=usb --action=change # 557178 udevadm trigger --subsystem-match=usb if dpkg --compare-versions "$2" le "2.6.4-2~" && [ -f /etc/init.d/nut ] ; then if [ "`md5sum /etc/init.d/nut | cut -d ' ' -f 1`" = 72f1dbc6b92cb4407f26605d05b12681 ]; then rm -f /etc/init.d/nut else mv /etc/init.d/nut /etc/init.d/nut.dpkg-old fi update-rc.d nut remove >/dev/null fi ;; abort-upgrade) # do nothing ;; abort-remove) # do nothing ;; abort-deconfigure) # do nothing ;; *) echo "$0: incorrect arguments: $*" >&2 exit 1 ;; esac #DEBHELPER# exit 0 debian/nut-server.dirs0000644000000000000000000000001512244455113012160 0ustar /var/lib/nut debian/nut-cgi.install0000644000000000000000000000027712244455113012133 0ustar debian/tmp/etc/nut/hosts.conf debian/tmp/etc/nut/upsset.conf debian/tmp/etc/nut/upsstats.html debian/tmp/etc/nut/upsstats-single.html debian/tmp/usr/lib/cgi-bin/ debian/tmp/usr/share/nut/www debian/description.subst0000644000000000000000000000047612244455113012603 0ustar description=nut is a client/server uninterruptible power supply (UPS) monitoring system${Newline}${Space}that permits the sharing of one (or more) UPS between several machines. The${Newline}${Space}'server' monitors the UPS and notifies the 'clients' when the UPS is on${Newline}${Space}battery or has a low battery. debian/nut-monitor.xpm0000644000000000000000000001535312244455113012217 0ustar /* XPM */ static char * nut_monitor_xpm[] = { "32 32 291 2", " c None", ". c #C7A509", "+ c #D0B123", "@ c #CEAF21", "# c #CBAB15", "$ c #C5A305", "% c #C4A100", "& c #CAAB1A", "* c #E0C74E", "= c #E0C949", "- c #ECDA6F", "; c #FCF6C6", "> c #FDF7B5", ", c #E8D663", "' c #CEAF0E", ") c #CAA915", "! c #DFC858", "~ c #D1B42E", "{ c #C29E00", "] c #D6BB34", "^ c #FBEE92", "/ c #FFF792", "( c #FEF07A", "_ c #F9E857", ": c #F6E558", "< c #F5E55D", "[ c #EED500", "} c #D7B800", "| c #CCAB00", "1 c #CAA80A", "2 c #EFDA59", "3 c #EFDC69", "4 c #F0E289", "5 c #DBC350", "6 c #C8A714", "7 c #BE9700", "8 c #FFFEAA", "9 c #FCE955", "0 c #FCED74", "a c #FCF194", "b c #FDF4AD", "c c #F5E565", "d c #EFD91D", "e c #E6CA00", "f c #D2B000", "g c #D0B226", "h c #EAD65F", "i c #EDD852", "j c #E9D037", "k c #E6CC2E", "l c #ECD856", "m c #CDAF23", "n c #BD9500", "o c #FFFFD2", "p c #FCED72", "q c #FCEE7A", "r c #FDF087", "s c #FDF195", "t c #FDF4AB", "u c #FEF8C2", "v c #FEF9C0", "w c #FEF5AA", "x c #FBEE8A", "y c #F4E269", "z c #F4E058", "A c #F0DA49", "B c #EDD851", "C c #EBD96F", "D c #CCAD23", "E c #BC9400", "F c #FFFFD9", "G c #FDF5B0", "H c #FDFAD9", "I c #FDF9D4", "J c #FEF9D8", "K c #FEFBE3", "L c #FFFDEA", "M c #FFFCE4", "N c #FEFAD4", "O c #FBF3B8", "P c #F5E99B", "Q c #EBDA75", "R c #E0CA52", "S c #D8C03D", "T c #D6BE48", "U c #CCAC21", "V c #FFFFD6", "W c #FDF3A5", "X c #FDF9D0", "Y c #FCF4B9", "Z c #F9F2AB", "` c #F5E561", " . c #F1DE3B", ".. c #EFD91C", "+. c #E8CF1B", "@. c #E0C61C", "#. c #DBC01E", "$. c #D9BD21", "%. c #D6BA26", "&. c #D5B729", "*. c #D7BD43", "=. c #FFFFD4", "-. c #FCF3A2", ";. c #FDF9CE", ">. c #FBF4B9", ",. c #FAF2AA", "'. c #F5E86D", "). c #F3E14B", "!. c #F0DC2D", "~. c #EAD329", "{. c #E1C927", "]. c #DCC224", "^. c #D9BD23", "/. c #D5B921", "(. c #D2B522", "_. c #D3BA3E", ":. c #CBAC22", "<. c #A68E1A", "[. c #FFFCD8", "}. c #FCF2A0", "|. c #FEF8C9", "1. c #FCF4B1", "2. c #FAF1A2", "3. c #F5E666", "4. c #F2E045", "5. c #F0DB28", "6. c #E8D123", "7. c #E1C720", "8. c #DCC01D", "9. c #D9BC1A", "0. c #D7B916", "a. c #D3B41A", "b. c #C8B140", "c. c #B6A34A", "d. c #777B7D", "e. c #EFF0ED", "f. c #DCDECF", "g. c #F0EEDC", "h. c #F2ECC0", "i. c #F4EDA6", "j. c #F2E568", "k. c #F2DF3E", "l. c #F4DD12", "m. c #EBD118", "n. c #DDC420", "o. c #D1BA27", "p. c #C0AD37", "q. c #A5994E", "r. c #898464", "s. c #7F8077", "t. c #8F9396", "u. c #72746E", "v. c #D8DAD4", "w. c #E7E8E5", "x. c #E0E2E1", "y. c #DBDDDE", "z. c #CACDD3", "A. c #C2C6CD", "B. c #B7BBC8", "C. c #A9AFB8", "D. c #9CA0A7", "E. c #8E9396", "F. c #848888", "G. c #7E7F7B", "H. c #76786F", "I. c #7B7C77", "J. c #8C8E8A", "K. c #676965", "L. c #EFF1EE", "M. c #D6D9D4", "N. c #E4E5E3", "O. c #DFE0DC", "P. c #D9DCD7", "Q. c #CCCEC8", "R. c #C4C7BF", "S. c #BABDB5", "T. c #ADAFA7", "U. c #9FA199", "V. c #91938B", "W. c #84877F", "X. c #7B7D76", "Y. c #71736E", "Z. c #787975", "`. c #858783", " + c #5F615C", ".+ c #EFF0EE", "++ c #D5D8D3", "@+ c #E3E5E1", "#+ c #DCDDDA", "$+ c #D6D9D5", "%+ c #C9CCC7", "&+ c #C2C5BE", "*+ c #B8BBB4", "=+ c #ABAEA6", "-+ c #9C9F97", ";+ c #8E9089", ">+ c #81847D", ",+ c #787A74", "'+ c #6E716B", ")+ c #757772", "!+ c #7E807C", "~+ c #555752", "{+ c #D5D7D3", "]+ c #E0E2DE", "^+ c #DADBD8", "/+ c #D4D6D1", "(+ c #C8CAC5", "_+ c #C1C4BD", ":+ c #B6B9B3", "<+ c #A9ACA4", "[+ c #999C95", "}+ c #8A8D85", "|+ c #7F827B", "1+ c #767771", "2+ c #6D6F6A", "3+ c #757773", "4+ c #777975", "5+ c #4B4E49", "6+ c #F0F2EE", "7+ c #D3D6D1", "8+ c #DEE0DE", "9+ c #D8D9D6", "0+ c #D1D3CF", "a+ c #C6C8C3", "b+ c #BFC2BB", "c+ c #B5B8B1", "d+ c #A6A9A2", "e+ c #989B93", "f+ c #767773", "g+ c #70726F", "h+ c #434540", "i+ c #D2D5D0", "j+ c #DCDDDB", "k+ c #D4D6D2", "l+ c #CED0CB", "m+ c #C5C7C2", "n+ c #BEC1BA", "o+ c #B4B7B0", "p+ c #A7AAA2", "q+ c #767874", "r+ c #6A6C68", "s+ c #424440", "t+ c #EFF1ED", "u+ c #D1D4CF", "v+ c #DADCD8", "w+ c #D3D5D0", "x+ c #CCCFC9", "y+ c #C4C7C1", "z+ c #6A6B68", "A+ c #41433F", "B+ c #EDEFEC", "C+ c #D2D5CF", "D+ c #D9DAD7", "E+ c #D2D4CF", "F+ c #CBCEC8", "G+ c #D7D9D5", "H+ c #D1D3CE", "I+ c #CBCDC8", "J+ c #8A8C85", "K+ c #7D8079", "L+ c #696B65", "M+ c #7F807C", "N+ c #6A6C69", "O+ c #81827E", "P+ c #DEE0DD", "Q+ c #F1F2EF", "R+ c #DEE0DC", "S+ c #CFD2CC", "T+ c #C3C6C0", "U+ c #BBBEB7", "V+ c #ADB0A9", "W+ c #A2A59D", "X+ c #979A92", "Y+ c #8F928A", "Z+ c #92948F", "`+ c #9D9E99", " @ c #A9AAA6", ".@ c #868784", "+@ c #4B4D49", "@@ c #5E605B", "#@ c #959794", "$@ c #AEAFAC", "%@ c #B6B8B5", "&@ c #BABCB8", "*@ c #BDBEBB", "=@ c #B4B6B2", "-@ c #AAABA7", ";@ c #9E9F9B", ">@ c #888986", ",@ c #686A66", "'@ c #454743", " ", " ", " ", " ", " ", " ", " . + @ # $ ", " % & * = - ; > , ' ) ! ~ { ", " ] ^ / ( _ : < [ } | 1 2 3 4 5 6 ", " 7 8 9 0 a b c d e f g h i j k l m ", " n o p q r s t u v w x y z A B C D ", " E F G H I J K L M N O P Q R S T U ", " E V W X Y Z ` ...+.@.#.$.%.&.*.U ", " E =.-.;.>.,.'.).!.~.{.].^./.(._.:. ", " <.[.}.|.1.2.3.4.5.6.7.8.9.0.a.b.c. ", " d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s.t. ", " u.e.v.w.x.y.z.A.B.C.D.E.F.G.H.I.J. ", " K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z.`. ", " +.+++@+#+$+%+&+*+=+-+;+>+,+'+)+!+ ", " ~+.+{+]+^+/+(+_+:+<+[+}+|+1+2+3+4+ ", " 5+6+7+8+9+0+a+b+c+d+e+}+|+1+2+f+g+ ", " h+6+i+j+k+l+m+n+o+p+e+}+|+1+2+q+r+ ", " s+t+u+v+w+x+y+n+o+p+e+}+|+1+2+q+z+ ", " A+B+C+D+E+F+y+n+o+p+e+}+|+1+2+4+z+ ", " s+6+7+G+H+I+y+n+c+p+e+J+K+u.L+M+N+ ", " O+P+Q+R+S+T+U+V+W+X+Y+Z+`+ @.@+@ ", " A+@@#@$@%@&@*@=@-@;@>@,@'@ ", " ", " ", " ", " ", " "}; debian/nut-client.tmpfiles0000644000000000000000000000003512244455113013014 0ustar d /run/nut 0770 root nut - - debian/nut-monitor.install0000644000000000000000000000052512244455113013054 0ustar scripts/python/app/NUT-Monitor usr/bin/ scripts/python/app/nut-monitor.desktop usr/share/applications/ scripts/python/app/gui-*.glade usr/share/nut-monitor/ scripts/python/app/locale/ usr/share/ scripts/python/app/nut-monitor.png usr/share/pixmaps/ scripts/python/app/pixmaps usr/share/nut-monitor/ debian/nut-monitor.xpm usr/share/pixmaps/ debian/nut-doc.doc-base.nut-faq0000644000000000000000000000047612244455113013520 0ustar Document: nut-faq Title: NUT Frequently asked questions Author: Arnaud Quette Abstract: Frequently asked questions for Network UPS Tools (NUT) Section: Help/FAQ Format: PDF Files: /usr/share/doc/nut-doc/pdf/FAQ.pdf Format: HTML Index: /usr/share/doc/nut-doc/html/FAQ.html Files: /usr/share/doc/nut-doc/html/FAQ.html debian/nut-client.links0000644000000000000000000000005512244455113012313 0ustar etc/init.d/nut-client etc/init.d/ups-monitor debian/Makefile.am0000644000000000000000000000105012244455113011217 0ustar EXTRA_DIST = changelog control copyright description.subst hotplug \ nut-cgi.config nut-cgi.docs nut-cgi.examples nut-cgi.postinst nut-cgi.postrm \ nut-cgi.preinst nut-cgi.README.Debian nut-cgi.templates nut.config \ nut.default nut.dirs nut.docs nut.examples nut-hal-drivers.docs \ nut-server.init nut-client.init nut-client.links \ nut.postinst nut.postrm nut.preinst nut.prerm nut.README.Debian \ nut.templates nut.TODO.Debian rules watch \ po/ca.po po/cs.po po/de.po po/fr.po po/POTFILES.in \ po/pt.po po/pt_BR.po po/templates.pot po/vi.po debian/copyright0000644000000000000000000000511312244455113011122 0ustar This package was debianized by Luca Filipozzi on Wed Jun 28 19:48:05 PDT 2000 It was downloaded from http://www.networkupstools.org/ Upstream Authors: Russell Kroll Arnaud Quette Arjen de Korte Charles Lepple Kjell Claesson David Goncalves and the NUT Team Copyright: Copyright (C) 2000-2008 Russell Kroll, Arnaud Quette and the NUT Team Licenses: Most files are licensed under the GNU General Public License (GPL) version 2, or (at your option) any later version. The files in the scripts/python/ directory are released under GNU General Public License (GPL) version 3, or (at your option) any later version. GPL-2 ----- 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; either version 2 of the License, or (at your option) any later version. 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. On Debian systems, the full text of the GNU General Public License v2 may be found in /usr/share/common-licenses/GPL-2. GPL-3 ----- 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, either version 3 of the License, or (at your option) any later version. 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 full text of the GNU General Public License v3 may be found in /usr/share/common-licenses/GPL-3. The Debian packaging is Copyright (C) 2008, Arnaud Quette and is licensed under the GPL, see `/usr/share/common-licenses/GPL'. debian/nut-xml.manpages0000644000000000000000000000005312244455113012306 0ustar debian/tmp/usr/share/man/man8/netxml-ups.8 debian/nut-client.install0000644000000000000000000000156412260230776012653 0ustar debian/tmp/bin/upslog debian/tmp/bin/upsc debian/tmp/bin/upsrw debian/tmp/bin/upscmd debian/tmp/sbin/upsmon debian/tmp/sbin/upssched debian/tmp/bin/upssched-cmd debian/tmp/etc/nut/nut.conf debian/tmp/etc/nut/upsmon.conf debian/tmp/etc/nut/upssched.conf debian/tmp/usr/share/apport/package-hooks/source_nut-client.py debian/tmp/usr/share/augeas/lenses/dist/nuthostsconf.aug debian/tmp/usr/share/augeas/lenses/dist/nutnutconf.aug debian/tmp/usr/share/augeas/lenses/dist/nutupsconf.aug debian/tmp/usr/share/augeas/lenses/dist/nutupsdconf.aug debian/tmp/usr/share/augeas/lenses/dist/nutupsdusers.aug debian/tmp/usr/share/augeas/lenses/dist/nutupsmonconf.aug debian/tmp/usr/share/augeas/lenses/dist/nutupsschedconf.aug debian/tmp/usr/share/augeas/lenses/dist/nutupssetconf.aug debian/tmp/usr/share/augeas/lenses/dist/tests/test_nut.aug debian/tmp/usr/share/bash-completion/completions/nut debian/nut-server.init0000644000000000000000000001231412244455113012167 0ustar #! /bin/sh ### BEGIN INIT INFO # Provides: nut-server upsd # Required-Start: $local_fs $syslog $network $remote_fs udev # Required-Stop: $local_fs $syslog $network $remote_fs udev # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Network UPS Tools initscript # Description: This script take care of starting and stopping the # Network UPS Tools components. When needed, it also # handle the UPS hardware shutdown. ### END INIT INFO # Author: Arnaud Quette PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin NAME=nut-server DESC="NUT - power devices information server and drivers" CONFIG=/etc/nut/nut.conf pid_dir=/var/run/nut upsd_pid=${pid_dir}/upsd.pid upsd=/sbin/upsd upsdrvctl=/sbin/upsdrvctl log=">/dev/null 2>/dev/null" # Define LSB log_* functions. # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. . /lib/lsb/init-functions # set upsd specific options. use "man upsd" for more info # this parameter is now located in nut.conf, and not in /etc/default/nut anymore # FIXME: retrieved from 'nut' script during update UPSD_OPTIONS="" # Exit if the package is not installed [ -x "$upsd" ] || exit 0 # Include NUT nut.conf [ -r $CONFIG ] && . $CONFIG # Explicitly require the configuration to be done in /etc/nut/nut.conf # redundant with nut-client if [ "x$MODE" = "xnone" -o -z "$MODE" ] ; then log_action_msg "$NAME disabled, please adjust the configuration to your needs" log_action_msg "Then set MODE to a suitable value in $CONFIG to enable it" # exit success to avoid breaking the install process! exit 0 fi # Check if /var/run/nut exists and has the correct perms check_var_directory() { [ ! -d ${pid_dir} ] && mkdir -p ${pid_dir} \ && chown root:nut ${pid_dir} \ && chmod 770 ${pid_dir} \ && [ -x /sbin/restorecon ] && /sbin/restorecon ${pid_dir} } # check if the right components are running check_status() { case "$MODE" in standalone|netserver) status_of_proc -p $upsd_pid $upsd upsd # FIXME: need driver(s) status too! ;; none|netclient|*) # defered to nut-client #status_of_proc -p $upsmon_pid $upsmon upsmon ;; esac } start_stop_server () { case "$MODE" in standalone|netserver) case "$1" in start) # First, start driver(s) ! $upsdrvctl start >/dev/null 2>&1 && \ log_progress_msg " (driver(s) failed)." || log_progress_msg " driver(s)." # Then, data server (upsd) start-stop-daemon -S -p $upsd_pid -x $upsd \ -- $UPSD_OPTIONS >/dev/null 2>&1 && log_progress_msg "upsd" || log_progress_msg "(upsd failed)" ;; stop) # FIXME: should stop nut-client first! # Reverse order for stop start-stop-daemon -K -o -p $upsd_pid -n upsd && #>/dev/null 2>&1 && log_progress_msg "upsd" || log_progress_msg "(upsd failed)" ! /sbin/upsdrvctl stop >/dev/null 2>&1 && \ log_progress_msg "(driver(s) failed)" || log_progress_msg "driver(s)" ;; esac ;; none|netclient|*) # now handled by nut-client return 1 ;; esac } case "$1" in start) log_daemon_msg "Starting $DESC" check_var_directory start_stop_server start #&& log_progress_msg "upsd" #start_stop_client start && log_progress_msg "upsmon" log_end_msg 0 ;; stop) log_daemon_msg "Stopping $DESC" start_stop_server stop #&& log_progress_msg "upsd" #start_stop_client stop && log_progress_msg "upsmon" log_end_msg 0 ;; reload) $upsd -c reload >/dev/null 2>&1 #$upsmon -c reload >/dev/null 2>&1 ;; restart|force-reload) log_daemon_msg "Restarting $DESC" #start_stop_client stop start_stop_server stop sleep 5 check_var_directory start_stop_server start #&& log_progress_msg "upsd" #start_stop_client start && log_progress_msg "upsmon" log_end_msg 0 ;; status) #log_daemon_msg "Checking status of $DESC" echo "Checking status of $DESC" check_status exit $? ;; poweroff) wait_delay=`sed -ne 's#^ *POWEROFF_WAIT= *\(.*\)$#\1#p' /etc/nut/nut.conf` # UPS poweroff action is actually done here. # But nut-monitor (Ie nut-client) does the check and call nut-server if needed! # This action MUST NOT be called directly, and thus is not exposed in 'Usage' case "$MODE" in standalone|netserver) log_daemon_msg "Shutting down the UPS ..." if $upsdrvctl shutdown ; then # FIXME (needed?): sleep 5 log_progress_msg "Waiting for UPS to cut the power" log_end_msg 0 else log_progress_msg "Shutdown failed." log_progress_msg "Waiting for UPS batteries to run down" log_end_msg 0 fi if [ -n "$wait_delay" ] ; then log_daemon_msg " (will reboot after $wait_delay) ..." sleep "$wait_delay" invoke-rc.d reboot stop fi ;; none|netclient|*) # nothing to do ;; esac ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|reload|restart|force-reload|status}" >&2 exit 1 ;; esac exit 0 debian/nut-cgi.README.Debian0000644000000000000000000000243212244455113012576 0ustar Network UPS Tools - CGI Interface - Quick Start for Debian ---------------------------------------------------------- (I) Installation ================= 1) Sample configuration files are provided in /etc/nut/ Rename without the ".sample" suffix the files hosts.conf, upsstats.html, upsstats-single.html and optionaly upsset.conf. Then edit these to match your configuration. 2) Ensure these configuration files are readable by others chmod 755 /etc/nut chmod 644 /etc/nut/upsset.conf chmod 644 /etc/nut/hosts.conf chmod 644 /etc/nut/upsstats.html chmod 644 /etc/nut/upsstats-single.html 3) You will then be able to access NUT CGI through a Web browser. The URL, which depends on your httpd configuration, is: http://localhost/cgi-bin/nut/upsstats.cgi 4) NUT also provides a set of HTML files to wrap the CGIs. To use it, create a new virtual host with your preferred webserver, and point the Document Root to: /usr/share/nut/www/ You can also add an alias to an existing site, if it is supported: Alias /nut/ "/usr/share/nut/www/" Also ensure that the files in this directory have the suitable permissions. For more information on nut-cgi configuration, have a look at the following manual pages: - upsstats.html (5) - hosts.conf (5) - upsset.conf (5) debian/nut-client.postinst0000644000000000000000000000352712244455113013065 0ustar #!/bin/sh -e case "$1" in configure) # make sure the nut user exists and has correct memberships if ! getent group nut >/dev/null; then addgroup --quiet --system nut fi if ! getent passwd nut >/dev/null; then adduser --quiet --system --ingroup nut --home /var/lib/nut --no-create-home nut elif ! groups nut | grep -qw nut; then adduser nut nut fi # for Ubuntu, while waiting for a proper debconf # if ! groups nut | grep -qw dialout; then # adduser nut dialout # fi # make sure that conffiles are secured and have the correct ownerships # on first install if [ -z "$2" ] ; then if [ -d /etc/nut/ ] ; then chown root:nut /etc/nut/ fi for file in nut.conf upsmon.conf upssched.conf ; do if [ -f /etc/nut/$file ] ; then chown root:nut /etc/nut/$file chmod 640 /etc/nut/$file fi done fi # make sure that /var/run/nut exists and has the correct ownerships if [ ! -d /var/run/nut ] ; then mkdir -p /var/run/nut fi if [ -d /var/run/nut ] ; then chown root:nut /var/run/nut chmod 770 /var/run/nut if which restorecon >/dev/null 2>&1; then restorecon /var/run/nut fi fi if dpkg --compare-versions "$2" le "2.6.4-2~" && [ -f /etc/init.d/nut ] ; then if [ "`md5sum /etc/init.d/nut | cut -d ' ' -f 1`" = 72f1dbc6b92cb4407f26605d05b12681 ]; then rm -f /etc/init.d/nut else mv /etc/init.d/nut /etc/init.d/nut.dpkg-old fi update-rc.d nut remove >/dev/null fi ;; abort-upgrade) # do nothing ;; abort-remove) # do nothing ;; abort-deconfigure) # do nothing ;; *) echo "$0: incorrect arguments: $*" >&2 exit 1 ;; esac #DEBHELPER# exit 0 debian/nut-cgi.docs0000644000000000000000000000002112244455113011400 0ustar data/html/README debian/nut-server.tmpfiles0000644000000000000000000000003512244455113013044 0ustar d /run/nut 0770 root nut - - debian/nut-cgi.postrm0000644000000000000000000000116212244455113012003 0ustar #!/bin/sh -e case "$1" in remove) # remove sample file if those were previously (wrongly) installed for file in upsset.conf hosts.conf upsstats.html upsstats-single.html ; do if [ -f /etc/nut/${file}.sample ] ; then rm -f /etc/nut/${file}.sample fi done ;; purge) # do nothing ;; upgrade) # do nothing ;; failed-upgrade) # do nothing ;; abort-install) # do nothing ;; abort-upgrade) # do nothing ;; disappear) # do nothing ;; *) echo "$0: incorrect arguments: $*" >&2 exit 1 ;; esac #DEBHELPER# exit 0 debian/nut-snmp.manpages0000644000000000000000000000005112244455113012461 0ustar debian/tmp/usr/share/man/man8/snmp-ups.8 debian/changelog0000644000000000000000000027040112260241440011037 0ustar nut (2.7.1-1ubuntu1) trusty; urgency=medium * Merge with Debian; remaining changes: - debian/control: + remove Build-Depends on libpowerman0-dev + remove nut-powerman-pdu - debian/nut-powerman-pdu.{install,manpages}: dropped for now - debian/{nut-cgi,nut-server}.postinst: add nut to the dialout and nut groups unconditonally to handle the upgrade from hardy release. - debian/source_nut.py, debian/{nut,nut-server,nut-client}.install, debian/rules: Install apport hooks for all top-level nut packages. - debian/rules: Use udev version for Ubuntu - debian/series, debian/patches/backport-fix-lp753661.patch: re-enabled * Fix linking libupsclient. * Patch libtool.m4 and configure to support ppc64le. -- Matthias Klose Mon, 30 Dec 2013 10:37:07 +0100 nut (2.7.1-1) unstable; urgency=low * New upstream release (Closes: #730183) - Refresh debian/patches/0004-fix-systemd-service.patch - Rename libupsclient1 to libupsclient3 following the soname bump, rename libupsclient1-dev to libupsclient-dev, the package is not co-installable anyway * debian/rules, debian/control: Enable SSL support using libnss3 * d/p/0005-Provide-retry-options-for-upsdrvctl-and-drivers.patch, d/p/0006-ups-conf-maxretry.patch: By default, retry to start the drivers up-to three times, this should mitigate races with slow devices (Closes: #694717) * debian/nut-server.install, debian/nut-server.manpages: Install new drivers * Move bash-completion file to /usr/share/bash-completion/ * debian/patches/0007-killpower-path.patch: Revert POWERDOWNFLAG back to /etc/killpower * debian/nut-client.lintian-overrides: Add override for systemd-no-service-for-init-script ups-monitor * debian/rules: Drop static ordering for the initscripts and pass --restart-after-upgrade option to dh_installinit and dh_systemd_start to minimize the downtime of the daemons -- Laurent Bigonville Sun, 24 Nov 2013 20:57:51 +0100 nut (2.6.5-4) unstable; urgency=low * debian/control: Do not build nut-ipmi on hurd-i386 as freeipmi is not available on that platform. -- Laurent Bigonville Thu, 11 Jul 2013 12:29:58 +0200 nut (2.6.5-3) unstable; urgency=low [ Laurent Bigonville ] * debian/control: - Move libupsclient1 package to libs Section - Add libgd-dev to the Build-Depends, keep the other alternatives to ease the backports - Bump Standards-Version to 3.9.4 (no further changes) - Add autotools-dev to the build-dependencies so config.{guess,sub} are getting updated during build - Use canonical URL for the VCS-* fields - Add build-dependency against dh-systemd and bump minimal cdbs version so systemd helpers are called during build. * Added dep-8-tests to improve QA (from Ubuntu, closes: #708130) * debian/nut-monitor.menu, nut-monitor.xpm: Add Debian menu entry (Closes: #708813) * debian/rules: Drop manual creation of .service files symlink, this should be handled by dh_systemd now * debian/patches/0004-fix-systemd-service.patch: Also add Wants/Before for systemd-udev-settle.service in the nut-driver.service as it got renamed after udev merge * debian/patches/0004-fix-systemd-service.patch: Fix path for upsdrvctl in scripts/systemd/nutshutdown.in [ Ivo De Decker ] * debian/nut-client.preinst: also revert /etc/nut/nut.conf mangling done by postinst during upgrade from lenny to squeeze (Really closes: #677054) Thanks to Andreas Beckmann for the review. -- Laurent Bigonville Thu, 11 Jul 2013 00:50:06 +0200 nut (2.6.5-2) experimental; urgency=low [ Laurent Bigonville ] * debian/control: Move the nut-monitor Suggests from nut-server to nut-client * Restore proper SELinux context for runtime created /var/run/nut directory * debian/control: Fix typo in package description * debian/watch: Update watch file URL (Thanks to Bart Martens) * debian/rules: Alias systemd nut-monitor service file to nut-client to prevent it from running twice * d/p/0004-fix-systemd-service.patch: Fix systemd service file for Debian * Install tmpfiles conf files to create /run/nut directory during boot [ Sébastien Villemot ] * debian/nut-client.preinst: revert /etc/nut/nut.conf mangling done by older versions of the postinst (Closes: #677054) [ Ivo De Decker ] * Only fix permissions of configfiles on first install. * Only remove /etc/init.d/nut from previous versions of nut in nut-server postinst if there are no local changes. * Also remove /etc/init.d/nut in nut-client postinst. Thanks to Laurent Bigonville for the hint. -- Laurent Bigonville Thu, 31 Jan 2013 21:51:31 +0100 nut (2.6.5-1) experimental; urgency=low [ Arnaud Quette ] * debian/control, debian/nut-ipmi.{install,manpages}: create IPMI support package * debian/nut-server.install: only install USB udev rules [ Laurent Bigonville ] * New upstream release - Drop debian/patches/0001-fix-upsmon-regression.patch, applied upstream * Follow multi-arch policy * Install systemd .service files (Closes: #679450) * debian/nut-server.install: Drop newmge-shut, renamed upstream to mge-shut and install the old implementation (oldmge-shut) instead * debian/control: Drop ancient Conflicts/Provides/Replaces * Install all development files under /usr -- Laurent Bigonville Mon, 13 Aug 2012 01:59:18 +0200 nut (2.6.4-2.3ubuntu2) saucy; urgency=low * Rebuild for libgd3 and libsnmp30. -- Colin Watson Mon, 20 May 2013 00:33:46 +0100 nut (2.6.4-2.3ubuntu1) saucy-proposed; urgency=low * Merge from Debian. Remaining changes: - debian/control: + remove Build-Depends on libpowerman0-dev + remove nut-powerman-pdu - debian/nut-powerman-pdu.{install,manpages}: dropped for now - debian/{nut-cgi,nut-server}.postinst: add nut to the dialout and nut groups unconditonally to handle the upgrade from hardy release. - debian/source_nut.py, debian/{nut,nut-server,nut-client}.install, debian/rules: Install apport hooks for all top-level nut packages. - debian/rules: Use udev version for Ubuntu - debian/series, debian/patches/backport-fix-lp753661.patch: re-enabled -- Jamie Strandboge Thu, 09 May 2013 12:38:31 -0500 nut (2.6.4-2.2ubuntu1) raring-proposed; urgency=low * Merge from Debian. Remaining changes: - debian/control: + remove Build-Depends on libpowerman0-dev + remove nut-powerman-pdu - debian/nut-powerman-pdu.{install,manpages}: dropped for now - debian/{nut-cgi,nut-server}.postinst: add nut to the dialout and nut groups unconditonally to handle the upgrade from hardy release. - debian/source_nut.py, debian/{nut,nut-server,nut-client}.install, debian/rules: Install apport hooks for all top-level nut packages. - debian/rules: Use udev version for Ubuntu - debian/series, debian/patches/backport-fix-lp753661.patch: re-enabled * Dropped the following patches, no longer required: - debian/patches/CVE-2012-2944.patch (included upstream) -- Jamie Strandboge Wed, 23 Jan 2013 07:32:58 -0600 nut (2.6.4-2) unstable; urgency=low * debian/rules: Stop the nut-client before nut-server on systems using static boot ordering (Closes: #679451) * debian/nut-server.postinst: Remove /etc/init.d/nut on upgrade (Closes: #677822) * Rename nut-server.lintian-overrides to nut-client.lintian-overrides and adjust overrides now that ups-monitor is shipped in nut-client package (Closes: #677947) * Add debian/patches/0001-fix-upsmon-regression.patch: Fix upsmon/upssched regression (Taken from upstream) (Closes: #679513) * Move nut metapackage to Section: metapackages * Also create nut user when installing nut-client package and do not delete it on purge anymore (Closes: #682000) * Drop /etc/default/nut → /etc/nut/nut.conf migration code, migration happends before squeeze release and this was against policy to have a maintainer script modifying a conffile in the first place (Closes: #684392) * Add dependency against adduser and lsb-base on nut-client package * Be sure that client is stopped before the server also when using dependencies based boot * Fix package descriptions (Closes: #678068) * Also install /bin/upssched-cmd in nut-client package as this script is referenced in default upssched.conf config file * debian/watch: Update watch file * Be sure that all maintainer scripts are returning 0 at their end -- Laurent Bigonville Sun, 12 Aug 2012 20:38:52 +0200 nut (2.6.4-1) unstable; urgency=high * New upstream release (Closes: #671444) * acknowledges NMU (Closes: #613643) * debian/nut-client.init: fix action "start" and use of log_*_*msg LSB log functions (Closes: #675619) * debian/nut-server.preinst: remove obsolete file(s) left in /etc/udev/rules.d and related processing: udev files are now located in /lib/udev/rules, and there is no reason to modify the dedicated USB UPS rules (52-nut-usbups.rules) (Closes: #660072) -- Arnaud Quette Wed, 06 Jun 2012 21:03:50 +0200 nut (2.6.3-2) unstable; urgency=low * debian/nut-server.init: rewrite to match upsd / drivers startup scope * debian/nut-client.init: created to match upsmon startup scope (Closes: #634858) * debian/nut.TODO.Debian, debian/Makefile.am: updated to reflect the above * debian/rules: install nut-client.init, and update to reflect the above * debian/control, debian/Makefile.am: updated to reflect the above * debian/control: - add Breaks on nut-server (<< 2.6.3-1~) - bump Standards-Version to 3.9.3 * debian/nut-client.links: renamed from debian/nut-server.links, since ups-monitor is now provided by nut-client initscript * debian/nut.README.Debian: renamed from nut-server.README.Debian, to provide it with both client and server packages * debian/nut-server.install: add missing drivers (clone-outlet, liebert-esp2 and microdowell) * debian/nut-server.manpages: add missing manual pages (apcsmart-old, ivtscd, liebert-esp2 and microdowell) -- Arnaud Quette Tue, 24 Jan 2012 13:14:59 +0100 nut (2.6.3-1ubuntu2) quantal; urgency=low * SECURITY UPDATE: remote denial of service - debian/CVE-2012-2944.patch: limit the set of parsed characters to ' ' through '~' - CVE-2012-2944 -- Jamie Strandboge Wed, 30 May 2012 13:36:58 -0500 nut (2.6.3-1ubuntu1) precise; urgency=low * Merge from Debian testing. Remaining changes: - debian/control: Drop Build-Depends on libpowerman0-dev (currently in universe) - debian/{nut-cgi,nut-server}.postinst: add nut to the dialout and nut groups unconditonally to handle the upgrade from hardy release. - debian/nut-powerman-pdu.{install,manpages}: dropped for now. - debian/source_nut.py, debian/{nut,nut-server,nut-client}.install, debian/rules: Install apport hooks for all top-level nut packages. - debian/rules: Use udev version for Ubuntu. - debian/series, debian/patches/backport-fix-lp753661.patch: re-enabled. -- Chuck Short Mon, 06 Feb 2012 09:23:24 -0500 nut (2.6.3-1) unstable; urgency=low * New upstream release (Closes: #635186, #598741, #633756, #638221) * debian/nut-server.{install,manpages}: add richcomm_usb * debian/nut-server.install, debian/rules: install Avahi service file * debian/rules, nut-client.install: install Augeas lenses * debian/nut-server.README.Debian: clarify udev explanation (Closes: #529664) * debian/patches/0001-fix_spelling_and_typo.patch, debian/patches/0003-libupsclient-version.patch: removed since these are now fixed upstream * debian/patches/series: updated -- Arnaud Quette Tue, 24 Jan 2012 13:14:59 +0100 nut (2.6.2-1ubuntu1) precise; urgency=low * Merge from debian unstable. Remaining changes: - debian/control: Drop Build-Depends on libpowerman0-dev (currently in universe) - debian/{nut-cgi,nut-server}.postinst: add nut to the dialout and nut groups unconditonally to handle the upgrade from hardy release. - debian/nut-powerman-pdu.{install,manpages}: dropped for now. - debian/source_nut.py, debian/{nut,nut-server,nut-client}.install, debian/rules: Install apport hooks for all top-level nut packages. - debian/rules: Use udev version for Ubuntu. - debian/series, debian/patches/backport-fix-lp753661.patch: re-enabled. -- Chuck Short Tue, 04 Oct 2011 05:45:12 +0000 nut (2.6.2-1) unstable; urgency=low * New upstream release (Closes: #594989) * debian/control: - remove legacy Build-Depends for nut-hal-drivers on libdbus and libglib - Build-Depends-Indep on docbook-xsl for offline document generation (Closes: #635347) * debian/nut-server.install: add apcsmart-old * debian/nut-server.init: - add udev as Required-Start/Stop (Closes: #642412) - remove legacy support for /etc/default/nut (Closes: #638021) * debian/patches/0003-libupsclient-version.patch: added to fix the missing libupsclient version info bump * debian/libupsclient1-dev.links: update link name * debian/libupsclient1.symbols: add with upscli_tryconnect * debian/nut.TODO.Debian: update and complete the TODO list -- Arnaud Quette Thu, 29 Sep 2011 18:39:16 +0200 nut (2.6.1-2ubuntu2) oneiric; urgency=low * Fix FTBFS for Ubuntu (LP: #815760): - debian/control: Build-Depends-Indep on docbook-xsl for offline document generation. -- James Page Mon, 25 Jul 2011 12:02:48 +0100 nut (2.6.1-2ubuntu1) oneiric; urgency=low * Merge from Debian unstable (LP: #811976). Remaining changes: - debian/control: Drop Build-Depends on libpowerman0-dev (currently in universe) - debian/{nut-cgi,nut-server}.postinst: add nut to the dialout and nut groups unconditonally to handle the upgrade from hardy release. - debian/nut-powerman-pdu.{install,manpages}: dropped for now. - debian/source_nut.py, debian/{nut,nut-server,nut-client}.install, debian/rules: Install apport hooks for all top-level nut packages. - debian/rules: Use udev version for Ubuntu. - debian/series, debian/patches/backport-fix-lp753661.patch: re-enabled. -- James Page Fri, 22 Jul 2011 14:12:46 +0100 nut (2.6.1-2) unstable; urgency=low * debian/nut.README.Debian: Adjust udev rules naming for permissions override (Closes: #529664) * Re-add and refresh debian/patches/0001-fix_spelling_and_typo.patch: Some typos and spelling errors remain. * Split nut package into nut-client and nut-server, keep nut package as metapackage * Generate PDF and html doc and install it in nut-doc package * debian/rules: - List non-installed files - Includes python-module.mk - Add flags to build documentation and install it * debian/control: - Add python-nut package and add python build-dependency - Set nut-powerman-pdu priority to extras - Add nut-monitor package - Add nut-doc package and add required C/R/P - Add libups-nut-perl package * debian/nut-server.prerm: Remove /var/run/nut during removal -- Laurent Bigonville Sun, 17 Jul 2011 19:03:18 +0200 nut (2.6.1-1ubuntu1) oneiric; urgency=low * Merge from debian unstable. Remaining changes: - debian/control: + Drop Build-Depends on libpowerman0-dev (currently in universe) - debian/{nut-cgi,nut}.postinst: add nut to the dialout and nut groups unconditonally to handle the upgrade from hardy release. - debian/nut-powerman-pdu.{install,manpages}: dropped for now. - debian/source_nut.py, debian/nut.install, debian/rules: Install apport hook. - debian/rules: Use udev version for Ubuntu. * debian/patches/backport-fix-lp753661.patch: Refreshed. * Drop changes due to .pc being not clean. -- Andres Rodriguez Mon, 06 Jun 2011 13:38:09 -0400 nut (2.6.1-1) unstable; urgency=low * New upstream release (Closes: #595953, #614842, #595773) * debian/patches/*.patch: removed since these are now fixed upstream [Laurent Bigonville] * Drop HAL package and build-dependencies (Closes: #613197) * debian/control: - Bump Standards-Version to 3.9.2 (no further changes) - Drop autotools build-dependencies (not needed anymore) - Drop non-existing build-dependencies * debian/rules: - Correctly pass flags to configure -- Arnaud Quette Wed, 01 Jun 2011 22:34:28 +0200 nut (2.6.0-2ubuntu1) oneiric; urgency=low * Merge from debian unstable (LP: #789323). Remaining changes: + debian/control: - Update maintainer as per spec. - Add Breaks on nut-hal-drivers to ensure we have correct udev version. - Drop libpowerman0-dev from the Build-Depends (currently in universe) + debian/{nut-cgi,nut}.postinst: add nut to the dialout and nut groups unconditonally to handle the upgrade from hardy release. + debian/nut-powerman-pdu.install, debian/nut-powerman-pdu.manpages: dropped for now. + debian/nul-hal-drivers.{docs,install,postinst,preinst}: Dropped since hal is in universe now + debian/nut.links: must create the init script link, used if the upse needs to be powered down (LP: #357583) + debian/source_nut.py, debian/nut.install, debian/rules: Install apport hook. + debian/patches/backport-fix-lp753661.patch + Dropped: - debian/patches/fix_pc_file.patch: replaced by debian's 0002-fix_libupsclient_pc.patch * debian/patches/fix_pc_file.patch: add DEP3 patch header * debian/patches/debian-changes-2.6.0-1: remove that accidental file -- Scott Moser Fri, 27 May 2011 16:16:10 -0400 nut (2.6.0-2) unstable; urgency=low * debian/nut-snmp.docs: Distribute snmp.txt doc file (Closes: #548295) * d/p/0001-fix_spelling_and_typo.patch: Update and refresh * debian/nut.lintian-overrides: Fix typo * debian/patch/0002-fix_libupsclient_pc.patch: Fix libupsclient.pc (Closes: #624255) * debian/rules: - Switch to cdbs - Remove not existing configure options (Closes: #611813) - Drop Phony rules (Closes: #613699) * debian/control: - Add cdbs build-dependency -- Laurent Bigonville Sun, 08 May 2011 21:23:46 +0200 nut (2.6.0-1ubuntu3) natty; urgency=low * debian/patches/backport-fix-lp753661.patch: Backport fix to trim extraneous end-of-line, in buggy HID string tables, which results in upsc breaking the communication pipe. (LP: #753661) -- Chuck Short Wed, 20 Apr 2011 10:47:05 -0400 nut (2.6.0-1ubuntu2) natty; urgency=low * fix_pc_file.patch: fix .pc source files by using LIBSSL_LIBS instead of LIBSSL_LDFLAGS to avoid a FTBFS in packages that uses libupsclient.pc (LP: #743484) -- Fabrice Coutadeur Sun, 27 Mar 2011 08:21:01 +0200 nut (2.6.0-1ubuntu1) natty; urgency=low * Merge from Debian unstable, remaining changes: + debian/control: - Update maintainer as per spec. - Add Breaks on nut-hal-drivers to ensure we have correct udev version. - Drop libpowerman0-dev from the Build-Depends (currently in universe) + debian/{nut-cgi,nut}.postinst: add nut to the dialout and nut groups unconditonally to hanle the upgrade from hardy release. + debian/nut-powerman-pdu.install, debian/nut-powerman-pdu.manpages: dropped for now. + debian/nul-hal-drivers.{docs,install,postinst,preinst}: Dropped since hal is in universe now + debian/nut.links: must create the init script link, used if the upse needs to be powered down (LP: #357583) + debian/source_nut.py, debian/nut.install, debian/rules: Install apport hook. + Dropped: - debian/patches/0002-fix_udev_action.patch: Accepted upstream. - debian/patches/0004-netvision-improvements-lp-600950: no longer needed. - debian/patches/0005-fix-nut-m4.patch: no longer needed. - debian/patches/9999-autoconf.patch: no longer needed. -- Chuck Short Wed, 23 Feb 2011 09:01:35 -0500 nut (2.6.0-1) unstable; urgency=low * New upstream release (Closes: #575176, #588648, #609597, #687985) * debian/patches/*.patch: removed since these are now fixed upstream * debian/patches/0001-fix_spelling_and_typo.patch, debian/patches/series: reworked to match the new upstream release * debian/nut.install, debian/nut.manpages: remove obsolete reference to megatec and megatec_usb, now respectively replaced by blazer_ser and blazer_usb * debian/nut.docs: limit distributed documentation -- Arnaud Quette Wed, 16 Feb 2011 22:55:26 +0100 nut (2.4.3-3) UNRELEASED; urgency=low * debian/control: - Wrap build-dependencies - Change nut-cgi Recommends to apache2 | httpd-cgi * debian/nut.postinst: Only trigger USB subsystem, should Closes: #574769 * debian/patches/0002-fix_udev_action.patch: Use SUBSYSTEM instead of BUS -- Laurent Bigonville Tue, 11 Jan 2011 22:24:07 +0100 nut (2.4.3-2ubuntu4) natty; urgency=low * debian/control, debian/rules, debian/nut-hal-drivers.{docs,install,postinst,preinst}: Drop nut-hal-drivers since Nut doesnt go into universe. -- Chuck Short Thu, 27 Jan 2011 11:18:14 -0500 nut (2.4.3-2ubuntu3) natty; urgency=low * Split patches/debian-changes-2.4.3-2ubuntu1 into patches/0005-fix-nut-m4.patch and patches/9999-autoconf.patch * Readd lost debian/patches0004-netvision-improvements-lp-600950.patch patch (LP: #707050) * debian/patches/0002-fix_udev_action.patch: Change BUS to SUBSYSTEMS, since the former is deprecated. (LP: #692171) * debian/nut.postinst: Uncomment missing call to adduser -- Laurent Bigonville Thu, 27 Jan 2011 09:18:20 -0500 nut (2.4.3-2ubuntu2) natty; urgency=low * debian/control: Drop hal build dependency, we don't need the daemon to build the package. Add a hal dependency to nut-hal-drivers, which is the only thing that actually needs it. -- Martin Pitt Thu, 27 Jan 2011 10:00:42 +0100 nut (2.4.3-2ubuntu1) natty; urgency=low * Merge from debian unstable. Remaining changes: + debian/control: - Update maintainer as per spec. - Add Breaks on nut-hal-drivers to ensure we have correct udev version. - Drop libpowerman0-dev from the Build-Depends (currently in universe) + debian/{nut-cgi,nut}.postinst: add nut to the dialout and nut groups unconditonally to hanle the upgrade from hardy release. + debian/nut-powerman-pdu.install, debian/nut-powerman-pdu.manpages: dropped for now. + debian/nut.links: must create the init script link, used if the upse needs to be powered down (LP: #357583) + debian/nut.postinst: Update udevadm trigger. "libusb_get_report: error sending control message: Operation not permitted" error on some UPS devices. (LP: #572262) + debian/source_nut.py, debian/nut.install, debian/rules: Install apport hook. + debian/patches/netvision-improvements-lp-600950.patch: Add improvements for netvision UPSes + Fix FTBFS with ld --as-needed. + Dropped: - debian/patches/03_udev_rules_change.dpatch: Use debian's instead. - debian/patches/04_nut_small-buffers.dpatch: Use debian's instead. -- Chuck Short Mon, 10 Jan 2011 21:21:02 +0000 nut (2.4.3-2) unstable; urgency=medium * debian/control: - Bump Standards-Version to 3.9.1 - Update Vcs-* fields to new GIT repository - Add myself as Uploaders * Switch to dpkg-source 3.0 (quilt) format (Closes: #573601) * debian/patches/0001-low_speed_usb_ups.patch: Use patch system for changes that were applied directly in the source * Add debian/gbp.conf file * debian/watch: Bump version to 3 * Add debian/patches/0002-fix_udev_action.patch: Also set permission for "change" udev ACTION (Closes: #557178) * debian/nut.postrm: Do not try to remove nut user is deluser is not installed anymore * debian/nut.manpages: Install manpage nut.conf.5 (Closes: #528222) * debian/copyright: Fix copyright-with-old-dh-make-debian-copyright * Remove nut-snmp.lintian-overrides, not needed anymore * debian/patches/0003-fix_spelling_and_typo.patch: Fix some spelling errors * Add debian/libupsclient1.symbols file * Add debian/nut.links: Re-add /etc/init.d/ups-monitor that was lost for some reasons (Closes: #592351) * debian/nut.lintian-overrides: Add override for init.d-script-does-not-provide-itself /etc/init.d/ups-monitor * Drop libupsclient1.post{inst,rm}: ldconfig call is added automatically by debhelper * debian/libupsclient1-dev.install: Do not ship /lib/libupsclient.la anymore * debian/rules: Remove dpatch logic as we are using package source version '3.0 (quilt)' * debian/compat: Bump debhelper compatibility to 8 -- Laurent Bigonville Fri, 24 Dec 2010 11:46:22 +0100 nut (2.4.3-1.1) unstable; urgency=low * Non-maintainer upload. * drivers/libhid.c: Apply r2407 from upstream to fix bug with some low speed UPS devices. (Closes: #583371) -- Tim Retout Fri, 15 Oct 2010 19:31:39 +0100 nut (2.4.3-1ubuntu6) natty; urgency=low * Fix FTBFS with ld --as-needed. -- Matthias Klose Mon, 10 Jan 2011 19:14:35 +0100 nut (2.4.3-1ubuntu5) maverick; urgency=low * debian/patches/netvision-improvements-lp-600950.patch: Add improvements for netvision UPSes (LP: #600950) -- Chuck Short Fri, 13 Aug 2010 13:28:10 -0500 nut (2.4.3-1ubuntu4) maverick; urgency=low * debian/source_nut.py, debian/nut.install, debian/rules: Install apport hook. -- Chuck Short Thu, 08 Jul 2010 11:06:30 -0400 nut (2.4.3-1ubuntu3.1) lucid-proposed; urgency=low * debian/patches/04_nut-small-buffers.dpatch: Fix "libusb_get_report: error sending control message: Operation not permitted" error on some UPS devices. (LP: #572262) -- Chuck Short Mon, 03 May 2010 13:38:37 -0400 nut (2.4.3-1ubuntu3) lucid; urgency=low * debian/nut.postinst: Revert dropping of --action=change. "add" events must not ever be triggered automatically. * Add 03_udev_rules_change.dpatch: Run udev rules on change events, too. -- Martin Pitt Tue, 23 Mar 2010 08:00:53 +0100 nut (2.4.3-1ubuntu2) lucid; urgency=low * debian/control: grr...fix ftbfs. -- Chuck Short Mon, 22 Mar 2010 11:48:02 -0400 nut (2.4.3-1ubuntu1) lucid; urgency=low * Merge from debian testing. Remaining changes (LP: #535152): + debian/control: - Update maintainer as per spec. - Add Breaks on nut-hal-drivers to ensure we have correct udev version. - Drop libpowerman0-dev from the Build-Depends (currently in universe) + debian/{nut-cgi,nut}.postinst: add nut to the dialout and nut groups unconditonally to hanle the upgrade from hardy release. + debian/nut-powerman-pdu.install, debian/nut-powerman-pdu.manpages: dropped for now. + debian/nut.links: must create the init script link, used if the upse needs to be powered down (LP: #357583) + debian/nut.postinst: Update udevadm trigger. + Dropped: - debian/patches/02-fix-trust-pw4130m.dpatch: No longer needed. -- Chuck Short Tue, 16 Mar 2010 06:22:26 +0000 nut (2.4.3-1) unstable; urgency=low * New upstream release (Closes: #544390, #528222, #539747, #526811, #562064) * debian/nut.install, debian/nut.manpages: - remove cyberpower driver and manpage - add bestfortress, clone and ivtscd drivers and manpages * debian/rules: - change udev dir to /lib/udev (Closes: #522327) - replace deprecated calls to 'dh_clean -k' by dh_prep (Closes: #536599) * debian/rules, debian/nut.install, debian/nut.install, debian/nut.README.Debian: install configuration files, without the sample suffix (Closes: #528641) * debian/nut.links: restored (Closes: #522506) * debian/nut.init: - source nut.conf instead of default/nut for POWEROFF_WAIT(Closes: #538173) - fix status checking (Closes: #538785) - improve detection of non configured system and beautify related output (Closes: #563112) - use 'invoke-rc.d' instead of calling the reboot script directly - add $remote_fs to Required-Start and Required-Stop * debian/nut.postrm: remove udev files and simplify cleanup (Closes: #541629) * debian/control: - remove Luca Filipozzi from the Uploaders list (Closes: #568987) - update Standards-Version to 3.8.4 - remove the debconf dependency - bump debhelper version to (>= 7) in Build-Depends, for dh_prep - add Breaks on nut-hal-drivers to ensure we have correct udev version * Remove debconf support since it was related to really old nut version (Closes: #518056): - remove nut-cgi.config, nut.config, nut-cgi.templates, nut.templates, and po/ directory - update nut-cgi.postinst * debian/nut.dirs: remove /var/run/nut to conform to Debian Policy * debian/nut.postint: - create /var/run/nut if needed - improve security checks * debian/nut.README.Debian: add a security note for ups.conf * debian/watch: URL update -- Arnaud Quette Wed, 24 Feb 2010 22:58:53 +0100 nut (2.4.1-3.2ubuntu2) lucid; urgency=low * debian/patches/02-fix-trust-pw4130m.dpatch: Fix issues with Trust PW-4130M UPS. (LP: #447586) -- Chuck Short Thu, 04 Feb 2010 13:26:33 -0500 nut (2.4.1-3.2ubuntu1) lucid; urgency=low * Resynchronize with debian, remaining changes: + debian/control: - Update maintainer field as per spec. - Add Breaks on nut-hal-drivers to ensure we have correct udev version. - Drop libpowerman0-dev from the Build-Depends (currently in universe). - Remove the nut-powerman-pdu package for now. + debian/{nut-cgi,nut}.postinst: add nut to the dialout and nut groups unconditionally, to handle the upgrade from hardy release. + debian/nut-powerman-pdu.install, debian/nut-powerman-pdu.manpages: dropped for now. + debian/nut.links: must create the init script link, used if the ups needs to be powered down. (LP: #357583) + debian/nut.init: Fix status_of_proc messages not to lie to the user (LP: #416182) -- Chuck Short Fri, 18 Dec 2009 09:00:45 -0500 nut (2.4.1-3.2) unstable; urgency=low * Non-maintainer upload. * nut.postinst: fix post-processing of nut.conf to avoid overriding user settings (Closes: #531220) -- Stefano Zacchiroli Thu, 26 Nov 2009 09:30:45 +0100 nut (2.4.1-3.1ubuntu1) lucid; urgency=low * Merge from debian testing, remaining changes: + debian/control: - Update maintainer field as per spec. - Add Breaks on nut-hal-drivers to ensure we have correct udev version. - Drop libpowerman0-dev from the Build-Depends (currently in universe) - remove the nut-powerman-pdu package for now + debian/{nut-cgi,nut}.postinst: add nut to the dialout and nut groups unconditionally, to handle the upgrade from hardy release. + debian/nut-powerman-pdu.install, debian/nut-powerman-pdu.manpages: dropped for now + debian/nut.links: must create the init script link, used if the ups needs to be powered down (LP: #357583) + debian/nut.init: Fix status_of_proc messages not to lie to the user (LP: #416182) -- Chuck Short Fri, 06 Nov 2009 01:34:44 +0000 nut (2.4.1-3.2) unstable; urgency=low * Non-maintainer upload. * nut.postinst: fix post-processing of nut.conf to avoid overriding user settings (Closes: #531220) -- Stefano Zacchiroli Thu, 26 Nov 2009 09:30:45 +0100 nut (2.4.1-3.1) unstable; urgency=low * Non-maintainer upload. * Fix length of extended descriptions of packages in debian/control * Fix pending l10n issues. Debconf translations: - Galician (marce villarino). Closes: #524263 - Spanish (Noel David Torres Taño). Closes: #525125 - Vietnamese (Clytie Siddall). Closes: #548170 -- Christian Perrier Tue, 20 Oct 2009 21:45:21 +0200 nut (2.4.1-3ubuntu2) karmic; urgency=low * debian/nut.init: Fix status_of_proc messages not to lie to the user. (LP: #416182) -- Chuck Short Wed, 23 Sep 2009 09:37:16 -0400 nut (2.4.1-3ubuntu1) karmic; urgency=low * Merge from debian unstable, remaining changes: + debian/control: - Update maintainer field as per spec. - Add Breaks on nut-hal-drivers to ensure we have correct udev version. - Drop libpowerman0-dev from the Build-Depends (currently in universe) - remove the nut-powerman-pdu package for now + debian/{nut-cgi,nut}.postinst: add nut to the dialout and nut groups unconditionally, to handle the upgrade from hardy release. + debian/nut-powerman-pdu.install, debian/nut-powerman-pdu.manpages: dropped for now. + debian/nut.links: must create the init script link, used if the ups needs to be powered down (LP: #357583) -- Chuck Short Thu, 28 May 2009 06:55:21 +0100 nut (2.4.1-3) unstable; urgency=low * Debconf templates and debian/control reviewed by the debian-l10n- english team as part of the Smith review project. Closes: #520591 * [Debconf translation updates] - Japanese. Closes: #521350, #518602 - Czech. Closes: #521662 - German. Closes: #518005 - Basque. Closes: #522390 - French. Closes: #522677 - Finnish. Closes: #522837 - Swedish. Closes: #522973 - Italian. Closes: #522987 - Russian. Closes: #523122 - Portuguese. Closes: #523600 -- Christian Perrier Sat, 21 Mar 2009 08:08:59 +0100 nut (2.4.1-2ubuntu4) jaunty; urgency=low * debian/nut.links: must create the init script link, used if the ups needs to be powered down, LP: #357583 -- Dustin Kirkland Thu, 09 Apr 2009 14:01:54 -0700 nut (2.4.1-2ubuntu3) jaunty; urgency=low Fixes for LP: #348454 * debian/control: add dpatch to Build-Depends, * debian/patches/*: back for the below fix * debian/patches/01_epdu_fix.dpatch: fix an upstream problem with Eaton PDUs vs untested PDUs from Raritan * debian/rules: reactivate again dpatch rules -- Arnaud Quette Wed, 25 Mar 2009 13:17:21 +0100 nut (2.4.1-2ubuntu2) jaunty; urgency=low [ Arnaud Quette ] * Fix FTBFS * debian/control: - drop libpowerman0-dev from the Build-Depends (currently in universe) - remove the nut-powerman-pdu package for now * debian/nut-powerman-pdu.install, debian/nut-powerman-pdu.manpages: dropped for now -- Dustin Kirkland Thu, 05 Mar 2009 14:34:06 -0600 nut (2.4.1-2ubuntu1) jaunty; urgency=low * Acknowledge closed bugs in upstream and Debian: LP: #1568, LP: #221737, LP: #239025, LP: #278495, LP: #332030, LP: #332032 * Merge from debian unstable, remaining changes: + debian/control: - Update maintainer field as per spec. - Add Breaks on nut-hal-drivers to ensure we have correct udev version. + debian/{nut-cgi,nut}.postinst: add nut to the dialout and nut groups unconditionally, to handle the upgrade from the hardy release (simply uncommented). + debian/rules: pre merge the changes for Ubuntu (udev path and version), (simply uncommented). -- Arnaud Quette Fri, 27 Feb 2009 12:49:24 +0100 nut (2.4.1-2) unstable; urgency=low * debian/control: - add Build-Depends libwrap0-dev to enable TCP wrappers support, - remove again dpatch from Build-Depends, - move back debconf to Depends since we don't use it anymore in the preinst, - add udev to nut-hal-drivers Depends so that it can use udevadm. * debian/rules: - pre merge the needed changes for Ubuntu (udev path and version), - deactivate again dpatch rules - move the nut-cgi HTML files off /var/www to /usr/share/nut/www - set dh_installdocs to ignore Makefile - remove dh_installexamples * debian/patches/*: removed since it doesn't address the issue * debian/nut-snmp.lintian-overrides: added to address NetSNMP overlinking * debian/nut.install: - add an precise list of the configuration files (Closes: #254355), - use a wildcard to specify the udev rules installation path * debian/nut-hal-drivers.install: use a wildcard to specify the udev rules installation path (either /etc or /lib) * debian/nut-cgi.install: add an precise list of the configuration files * debian/nut.preinst: - remove previous udev rule if unchanged, otherwise move to new filename (ie with a dash), - don't call adduser or addgroup *at all*, since these operations should be handled in the postinst, - migrate /etc/default/nut content to /etc/nut/nut.conf (part #1) * debian/nut-cgi.preinst: removed since its content is addressed by postinst. * debian/nut-hal-drivers.preinst: - remove previous udev rule if unchanged, otherwise move to new filename (ie with a dash), * debian/nut-hal-drivers.postinst: - reinstate since it was lost in the 2.2.2-10 merge, - use the safe way to install udev rules (udevadm trigger --action=change). * debian/nut.postinst: - use the safe way to install udev rules, as for nut-hal-drivers.postinst (udevadm trigger --action=change) - rework the user/group creation, and a commented add to the dialout group, - migrate /etc/default/nut content to /etc/nut/nut.conf (part #2) * debian/nut-cgi.postinst: rework the user/group creation, and a commented add to the dialout group. * debian/nut.postinst: reactivate the nut user removal upon purge * debian/nut.init: - use nut.conf instead of /etc/default/nut to start the right component(s) - enforce the configuration checking - add basic support for the status option (as required per LSB) * debian/nut.default: removed since its content has been incorporated into nut.conf * debian/{nut-cgi,nut}.examples: removed since the sample configuration files are now installed. * debian/nut.README.Debian: reworked with a lot of update and completion. * debian/nut-cgi.README.Debian: reworked with a lot of update and completion. -- Arnaud Quette Fri, 20 Feb 2009 10:09:52 +0100 nut (2.4.1-1) unstable; urgency=low * New upstream release * Acknowledge the use of debhelpers (Closes: #506583) * debian/copyright: authors and licensing (GPL2+ and GPL3+) completion * debian/control: - add a Pre-Depends on debconf for nut and nut-cgi, and remove the according Depends - add ${misc:Depends} to all Depends - add libpowerman0-dev to the Build-Depends - add a new nut-powerman-pdu package - add a Recommends on bash-completion for nut - remove Shaul Karl from the Uploaders as per his request * debian/nut-powerman-pdu.install, debian/nut-powerman-pdu.manpages: added for the nut-powerman-pdu package * debian/nut.install: - also list the bash_completion entry - list update due to upstream changes * debian/nut.manpages: list update due to upstream changes * debian/rules: - comment the patching rules - install the nut.bash_completion script * debian/patches/*: removed the previous patches since fixed upstream * debian/patches/01_snmp_ups_no_lcrypto.dpatch: add a patch to fix snmp-ups overlinking with lcrypto (lintian possible-gpl-code-linked-with-openssl) * debian/po/es.po: added Spanish debconf template translation (Closes: 512494) * debian/po/ja.po: added Japanese debconf template translation (Closes: 512865) * debian/watch: updated for the new 2.4 tree * debian/nut.prerm: replace the direct call to the init script by invoke-rc.d -- Arnaud Quette Tue, 17 Feb 2009 14:15:24 +0100 nut (2.2.2-10ubuntu3) jaunty; urgency=low * debian/{nut-cgi,nut}.preinst: don't call adduser or addgroup *at all*, these operations should be handled in the postinst. Since this is the only custom action at all for nut-cgi, remove that preinst completely. * debian/{nut-cgi,nut}.postinst: add nut to the dialout and nut groups unconditionally, to handle the upgrade from the hardy release. LP: #222761, LP: #287781. * debian/control: nut needs Pre-Depends: debconf instead of Depends:, because we use debconf unconditionally in the preinst. * reinstate debian/nut-hal-drivers.postinst, which was lost in a merge; and fix it up to use udevadm trigger --action=change, the safe way to install udev rules. * have nut-hal-drivers Depend: on udev so it can use the above. * fix up nut postinst to also use 'udevadm trigger --action=change' -- Steve Langasek Fri, 30 Jan 2009 01:06:53 +0000 nut (2.2.2-10ubuntu2) jaunty; urgency=low * debian/rules: Install udev rules into /lib/udev/rules, bump versioned dependency on udev. * debian/nut.install, debian/nut-hal-drivers.install: Update path * debian/patches/04-ubuntu-udev-rules-name.dpatch: Use a dash to separate the name, not an underscore. * debian/nut.preinst, debian/nut-hal-drivers.preinst: Remove previous rules if unchanged, otherwise move to new filename. * debian/control: Add Breaks to ensure we have correct udev version. -- Scott James Remnant Tue, 13 Jan 2009 02:50:14 +0000 nut (2.2.2-10ubuntu1) jaunty; urgency=low * Merge from debian unstable, remaining changes: + debian/control: - Update maintainer field as per spec. + debian/nut{-cgi,-hal-drivers}.preinst: - Add nut user to dialout group. + debian/nut.install - Install the configuration files in /etc/nut. -- Chuck Short Fri, 28 Nov 2008 23:01:47 +0000 nut (2.2.2-10) unstable; urgency=low * Merge from Ubuntu (Morten Kjeldgaard): * debian/compat: changed to 6 * debian/control: - bump Build-Depends on debhelper to (>= 6.0.7~) since we are now using dh_lintian. - add hal to Build-Depends since configure attempts to locate /usr/lib/hal in order to define callouts path and device information path * debian/rules: --prefix is back to /usr, --exec-prefix=/ and --libdir=/lib instead, which has the desired effect of moving the libraries to /lib. The many shell commands in debian/rules, for moving files from the install directory to the package directories have all been replaced by dh_* calls and matching .* files. * debian/{libupsclient1-dev.install, libupsclient1-dev.manpages, libupsclient1.install, nut-cgi.install, nut-cgi.manpages, nut-hal-drivers.install, nut-snmp.install, nut-snmp.manpages, nut-xml.install, nut-xml.manpages, nut.install, nut.lintian-overrides, nut.manpages}: added debhelper files. * debian/nut.dirs: modified debhelper files * debian/libupsclient1-dev.links: added to provide a link from /usr/lib/libupsclient.so -> /lib/libupsclient.so.1.0.0 This is a transitional measure, to salvage packages that have not yet been updated to the new library location. Can be removed sometime in the future. * debian/patches/03-configure.in.dpatch: patch to configure.in adding AC_CONFIG_MACRO_DIR([m4]) -- Arnaud Quette Thu, 27 Nov 2008 21:43:59 +0100 nut (2.2.2-9) unstable; urgency=low * debian/rules: also move libupsclient.so to /lib, otherwise the link is broken (Closes: #505101) * debian/nut-cgi.postinst: test if /etc/nut exists before chmod'ing (Closes: #502757) * debian/nut.TODO.Debian: some update and completion -- Arnaud Quette Wed, 15 Oct 2008 17:20:29 +0200 nut (2.2.2-8ubuntu1) jaunty; urgency=low * Merge from debian unstable, remaining changes: + debian/control: - Update maintainer field as per spec. + debian/nut{-cgi,-hal-drivers}.preinst: - Add nut user to dialout group. + debian/rules: - Move the configuration files to /etc/nut from examples. -- Chuck Short Wed, 05 Nov 2008 02:59:59 -0400 nut (2.2.2-8) unstable; urgency=high * debian/nut.links: restored since it's now handled by insserv (Closes: #500190) * debian/changelog: fix a typo error * debian/rules: move libupsclient.so.1 from /usr/lib to /lib (Closes: #491591) * debian/nut-cgi.README.Debian: fix the permissions on /etc/nut (Closes: #492277) * debian/control: add Vcs-Browser and Vcs-Svn fields -- Arnaud Quette Tue, 30 Sep 2008 21:37:59 +0200 nut (2.2.2-7) unstable; urgency=high * debian/nut.links: removed to satisfy insserv (Closes: #492734) * debian/po/it.po: add Italian debconf template translation (Closes: #495781) * debian/nut.preinst: force the nut user to be part of the extra group nut (Closes: #493159) -- Arnaud Quette Mon, 15 Sep 2008 17:18:28 +0200 nut (2.2.2-6ubuntu1) intrepid; urgency=low * Merge from debian unstable, remaining changes: + debian/control: - Update maintainer field as per spec. + debian/nut{-cgi,-hal-drivers}.preinst: - Add nut user to dialout group. + debian/rules: - Move the configuration files to /etc/nut from examples. -- Chuck Short Mon, 14 Jul 2008 00:54:42 +0100 nut (2.2.2-6) unstable; urgency=low * tag this bug as closed by the 2.2.2 release (Closes: #490048) * debian/nut.README.Debian: - fix the serial udev advice (Closes: #490182) - mention the UPS compatibility list (Closes: #447187) * debian/po/de.po: update German debconf template translation (Closes: #490128) * debian/changelog: fix a typo on 2.2.2-2 release urgency -- Arnaud Quette Fri, 11 Jul 2008 11:30:55 +0200 nut (2.2.2-5) unstable; urgency=low * debian/po/eu.po: add Basque debconf template translation (Closes: #489580) * debian/control: - add a Build-Depends on autoconfi, automake, libtool for the below patch - bump Depends on udev to 0.124-1 to complete the fix of #489831 * debian/rules: call autoreconf after patches application * debian/patches/02_g_timeout_add_seconds_patch.dpatch: fix compilation issue in the nut-hal-drivers code, when using a Glib older than 2.14 (Closes: #489742) * debian/nut.postint: replace the call to udevtrigger by udevadm trigger (Closes: #489831) -- Arnaud Quette Mon, 07 Jul 2008 11:04:52 +0200 nut (2.2.2-4) unstabl e; urgency=low * debian/rules: fix a Lintian warning (debian-rules-calls-debhelper-in-odd-order) * debian/po/fi.po: add Finnish debconf template translation (Closes: #489123) * debian/po/ru.po: add Russian debconf template translation (Closes: #489285) * debian/po/vi.po: update Vietnamese debconf template translation (Closes: #489393) * debian/nut.templates: remove nut/change_system_user since it is not used anymore (Closes: #486783) -- Arnaud Quette Sat, 05 Jul 2008 22:56:35 +0200 nut (2.2.2-3ubuntu1) intrepid; urgency=low * Merge from debian unstable, remaining changes: + debian/control: - Update maintainer field as per spec. + debian/nut{-cgi,-hal-drivers}.preinst: - Add nut to user to dialout group. + debian/rules: - Move the configuation files to /etc/nut from examples. -- Chuck Short Tue, 01 Jul 2008 11:57:01 +0100 nut (2.2.2-3) unstable; urgency=low * debian/rules: reactivate dpatch support * debian/control: add dpatch back to Build-Depends * debian/patches/00list: fix the matching of the NUT HAL .fdi file (Closes: #471828) * debian/po/fr.po: update French debconf template translation (Closes: #486740) * debian.po/de.po: update the German debconf template translation (Closes: #487187) * debian/po/sv.po: add Swedish debconf template translation (Closes: #488217) * debian.po/cs.po: update the Czech debconf template translation (Closes: #488355) * debian/po/pt.po: update the Portuguese debconf template translation (Closes: #488403) * debian/po/sv.po: add Galician debconf template translation (Closes: #488380) * debian/nut.config: fix a typo in comment -- Arnaud Quette Fri, 27 Jun 2008 16:18:29 +0200 nut (2.2.2-2) unstable; urgency=low * debian/rules: fix HAL files installation paths (Closes: #486362) * debian/control: - fix conflicts (Closes: #486704, #486705) - update Standards-Version to 3.8.0 -- Arnaud Quette Fri, 20 Jun 2008 21:29:31 +0200 nut (2.2.2-1ubuntu1) intrepid; urgency=low * Merge from debian unstable, remaining changes: + debian/control: - Update maintainer field as per spec. + debian/nut{-cgi,-hal-drivers}.preinst: - Add nut to user to dialout group. + debian/rules: - Move the configuration files to /etc/nut from examples + debian/patches/01_fix_megatec_regression.dpatch. - Dropped no longer since its fixed in this version. -- Chuck Short Wed, 18 Jun 2008 11:30:10 -0500 nut (2.2.2-1) unstable; urgency=low * New upstream release (Closes: #471828, #462468, #334105, #463150) * acknowledges NMUs (Closes: #469855) * debian/control: - add the new nut-xml package and its libneon dependency - add the new libupsclient1 and libupsclient1-dev packages, with the latter replacing nut-dev (Closes: #419684) - remove dpatch dependency * debian/rules: update according to upstream changes - replace --with-lib by --with-dev - update HAL integration - update for the nut-xml package - distribute the shared version of libupsclient - comment dpatch calls * debian/nut.postinst, debian/nut-hal-drivers.postinst: use udevtrigger to refresh the devices permissions (Closes: #469601, #475262) * debian/changelog: fix a typo * debian/nut.templates: fix the short and long descriptions * debian/libupsclient1.postinst, debian/libupsclient1.postrm: added to handle the calls to ldconfig * debian/nut.init: fix the call to /etc/init.d/reboot by adding the missing "stop" parameter (Closes: 482022) * debian/*.template: minor rework of the Debconf templates (Closes: 444151) -- Arnaud Quette Wed, 04 Jun 2008 13:35:41 +0200 nut (2.2.1-2.1ubuntu7) hardy; urgency=low * debian/patches/01_fix_megatec_regression.dpatch - Fix more megatec_usb driver regressions. (LP: #215389) -- Chuck Short Mon, 14 Apr 2008 14:25:48 -0400 nut (2.2.1-2.1ubuntu6) hardy; urgency=low * debian/patches/01_fix_megatec_regression.dpatch - Updated patch thanks to Alexander I. Gordeev . (LP: #209001) -- Chuck Short Thu, 10 Apr 2008 09:33:53 -0400 nut (2.2.1-2.1ubuntu5) hardy; urgency=low * debian/patches/01_fix_megatec_regression.dpatch - Readded support for various USB devices. (LP: #209001) -- Chuck Short Mon, 07 Apr 2008 08:46:46 -0400 nut (2.2.1-2.1ubuntu4) hardy; urgency=low * Use udevtrigger to restart udev. (LP: #204612) -- Chuck Short Wed, 26 Mar 2008 13:30:24 -0400 nut (2.2.1-2.1ubuntu3) hardy; urgency=low * Fix FTBFS. -- Chuck Short Sat, 22 Mar 2008 10:00:06 -0400 nut (2.2.1-2.1ubuntu2) hardy; urgency=low * Fix udev rules. (LP: #204612). * Cleaned up debian/control. -- Chuck Short Fri, 21 Mar 2008 20:30:44 -0400 nut (2.2.1-2.1ubuntu1) hardy; urgency=low * Merge from debian unstable (LP: #203366), remaining Ubuntu changes: + debian/rules: - Move the configuration files to /etc/nut from examples. + debian/nut{,-cgi,-hal-drivers}.preinst - Add nut user to dialout group. + debian/control: - Updated Maintainer field as per spec. -- Luca Falavigna Mon, 17 Mar 2008 23:59:38 +0100 nut (2.2.1-2.1) unstable; urgency=low * Non-maintainer upload. * Skip udev restart logic within chroots, closes: #469855. -- Joe Nahmias Sun, 09 Mar 2008 13:12:12 -0400 nut (2.2.1-2ubuntu1) hardy; urgency=low * Move the configuration files to /etc/nut from examples. (LP: #85598) * Add nut user to dialout group. (LP: #157079) * Updated Maintainer according to specs. -- Chuck Short Thu, 28 Feb 2008 10:10:24 -0500 nut (2.2.1-2) unstable; urgency=low * debian/po/de.po: update the German po-debconf translation (Closes: #464466) * nut-hal-drivers.preinst: created to add to HAL user to the NUT group (Closes: #460392) * debian/nut-hal-drivers.postinst: created to complete the above by restarting udev after the rules file installation * debian/changelog: Fix some Lintian reports (syntax and spelling errors) * debian/nut.README.Debian: completed a bit more for #334105 -- Arnaud Quette Fri, 8 Feb 2008 13:48:23 +0100 nut (2.2.1-1) unstable; urgency=low * New upstream release (Closes: #439986) * acknowledges NMUs (Closes: #447961, #445000) * debian/watch: update the URL to point the 2.2 tree * debian/rules: - force --udev-dir to remove udev from Build-Depends while keeping the feature (complete #447961 fix) - limit the above fix to linux systems not to break build on bsd and hurd these architectures (Closes: #460732) - fix lintian debian-rules-ignores-make-clean-error and do some more cleanup - remove the empty directories /usr/{include,lib} from the nut package * debian/nut.postinst: call invoke-rc.d instead of the udev init script (Closes: #442331) * debian/control: - remove udev from Build-Depends - update Standards-Version to 3.7.3 - remove Homepage from description and add it as a tag - add libsnmp-dev as an alternate Build-Depends to libsnmp9-dev * debian/po/nl.po: update the Dutch po-debconf translation (Closes: #447720) * debian/po/fr.po: update the French po-debconf translation (Closes: #442102) * debian/patches/*: removed since these have been applied upstream * debian/patches/00list: emptied but kept for future use -- Arnaud Quette Wed, 23 Jan 2008 17:13:13 +0100 nut (2.2.0-2.1) unstable; urgency=low * Non-maintainer upload with Arnaud's permission. * debian/nut.postinst: restart udev only if it is running already (Closes: #447961). * debian/nut.preinst: ignore db_get errors for nut/remove_debian_conf, thanks to Alexander Gerasiov for the patch (Closes: #445000). * Fixed typo in the date of the 2.2.0-2 changelog entry (Augl -> Aug). -- Sebastian Harl Tue, 8 Jan 2008 13:50:11 +0100 nut (2.2.0-2) unstable; urgency=low * debian/control: list udev as Build-Depends to allow the udev rules inclusion (Closes: #437811) * debian/nut.default: fix a typo error on UPSMON options comment (Closes: #439407) * debian/po/: - add Brazilian Portuguese debconf templates translation (Closes: #439793) - update Portuguese debconf templates translation (Closes: 440369) - update French debconf templates translation (Closes: 440524) * debian/Makefile.am: update with the missing files * debian/patches/03_libupsclient-config.dpatch: patch for the missing FLAGS (Closes: #439985) -- Arnaud Quette Wed, 29 Aug 2007 16:14:11 +0200 nut (2.2.0-1) unstable; urgency=low * New upstream release (Closes: #432909, #420016, #426033) * debian/control: - merge the nut-usb package into nut, and update the various needed fields (Depends, Provides, Conflicts, Suggests and Description) - requires at least libhal-dev 0.5.8 - complete the nut-hal-drivers Description (Homepage) - update to policy 3.7.2 - add po-debconf to Build-Depends * debian/rules: - general rewrite since the upstream now use automake - force the evaluation of DEB_HOST_ARCH_OS for dh_gencontrol - force udev to empty on non Linux system, for dh_gencontrol - remove the DH_COMPAT export - update the nut-usb specifics, not needed anymore - nut-hal-drivers also needs the udev rules - call debconf-updatepo to clean debconf translations * debian/compat: creation * debian/nut-usb.*: remove these files, and put the content in the matching nut.* files * debian/nut.preinst: remove the old udev rule file (025_nut...) which was manually installed, and now addressed upstream and called 52_nut. * debian/nut.postinst: restart udev to apply the USB rules to the already plugged devices * debian/nut-hal-drivers.preinst: created to add the HAL user to the nut group * debian/po/nl.po: added Dutch po-debconf translation (Closes: #414756) * debian/po/pt.po: added Portuguese po-debconf translation (Closes: #415189) * debian/patches/01_udev_rules_subsystem_usb.dpatch: update the patch * debian/patches/02_libupsclient.dpatch: patch for the missing FLAGS * debian/nut.templates: rewrite and simplification * debian/nut.config: rewrite and simplification * debian/rules: call dh_installinit with the priority set to 50 to (Closes: #385694) * debian/nut.default, debian/nut.init: allow to specify options for upsd and upsmon (Closes: #420020, #434503) -- Arnaud Quette Tue, 17 Jul 2007 09:14:11 +0200 nut (2.0.5-3) unstable; urgency=low * debian/patches/01_udev_rules_subsystem_usb.dpatch: rework that patch to be more generic -- Arnaud Quette Fri, 02 Feb 2007 15:38:59 +0100 nut (2.0.5-2) unstable; urgency=low * debian/patches/*: add a patch to fix the udev rule SUBSYSTEM from usb_device to usb (thanks to Joey Hess) (Closes: #409080) * debian/control: - replace the udev substvar by udev - nut Conflicts with nut-{usb,snmps} <= 2.0.4 and nut-{usb,snmp} Depends upon 2.0.5 (Closes: #407882) * debian/rules: dh_gencontrol no more calls -V for udev -- Arnaud Quette Thu, 01 Feb 2007 14:50:49 +0100 nut (2.0.5-1) unstable; urgency=low * New upstream release (Closes: #406045, #380304, #399741) * debian/rules: - replaces CHANGES by ChangeLog - replace the dummycons installation by dummy-ups - integrate the --with-htmlpath option * debian/nut-cgi.docs: created to install data/html/README * debian/nut.init: LSB compliance update * debian/control: add lsb-base (>= 3.0-6) to Depends for LSB compliance -- Arnaud Quette Tue, 16 Jan 2007 10:42:36 +0100 nut (2.0.4-3) unstable; urgency=high * acknowledges NMUs (Closes: #396704, #389350) * debian/nut-usb.postinst: remove the symlinking of the udev file since it's not useful anymore (Closes: #400215) * native udev rules are now used (Closes: #359802, #380304) * debian/po/de.po: add German po-debconf template translation (Closes: #400285) * debian/nut.config: change the medium priorities to high (Closes: #388945) * debian/nut.init: improve drivers startup report -- Arnaud Quette Wed, 20 Dec 2006 11:07:30 +0100 nut (2.0.4-2.3) unstable; urgency=high * Non-maintainer upload. * Some polish on top of the previous NMU. * Remove the hotplug alternative; we no longer support it, so it's no longer acceptable in place of udev. Correspondingly, rename the substvar to ${udev}. (Closes: #396704) * Drop debian/nut-usbups.rules and use upstream's rules instead. Modify debian/rules correspondigly, patch from Arnaud Quette. -- Steinar H. Gunderson Fri, 17 Nov 2006 01:12:54 +0100 nut (2.0.4-2.2) unstable; urgency=high * Non-maintainer upload. * In the udev script, replace the RUN actions by MODE and GROUP actions, as per suggestion from the maintainer; should fix permission issues. (Closes: #396704) -- Steinar H. Gunderson Thu, 16 Nov 2006 15:38:43 +0100 nut (2.0.4-2.1) unstable; urgency=low * NMU * not removing nut user on purge (Closes: #389350) -- Florian M. Weps Thu, 12 Oct 2006 11:19:37 +0200 nut (2.0.4-2) unstable; urgency=low * debian/rules: replace $PWD by CURDIR to satisfy buildd * debian/nut.default, debian/nut.init: make the bug 358696 workaround optional as it might be dangerous under some circumstances (closes: #358696) -- Arnaud Quette Tue, 01 Aug 2006 08:50:26 +0200 nut (2.0.4-1) unstable; urgency=low * New upstream release - driver do not use /var anymore when called for shutdown/poweroff (closes: #332846) - fixes the newhidups crash upon device reconnexion (closes: #354305, #359769) * debian/nut.preinst: syntax enhancement to avoid issue when the nut user already exists (closes: #378970) * debian/nut-cgi.postinst: fix wrong permissions (closes: #378818) * debian/po/cs.po: update Czech translation of nut debconf messages (closes: #366738) * debian/nut.default, debian/nut.init: "poweroff" workaround to deal with BIOS default of "On/Off state: Last state" and system halting itself before the UPS cuts power (closes: #358696) * debian/nut-usbups.rules: fix the broken udev rules (closes: #359801) -- Arnaud Quette Thu, 27 Jul 2006 15:20:46 +0200 nut (2.0.3-4) unstable; urgency=low * debian/nut-usb.postinst: generate the /etc/udev/rules/ file * debian/rules: - install the right udev rule file (not the upstream one) - install the debian/hotplug file as libhidups, as it's compatible with hotplug and udev styles -- Arnaud Quette Mon, 13 Mar 2006 08:52:25 +0100 nut (2.0.3-3) unstable; urgency=low * debian/rules: - fix a wrong symlink for the udev rule files (closes: #354262) - add a temporary workaround to clean drivers/tripplite_usb -- Arnaud Quette Mon, 27 Feb 2006 15:35:32 +0100 nut (2.0.3-2) unstable; urgency=low * debian/nut.init: fix the creation of the PID directory, as /var is now volative. This bug has been identified in Ubuntu (Launchpad #6679) * debian/nut-cgi.postrm: suppress the deletion of the nut user as it's not needed (closes: #319395) * debian/nut-cgi.preinst: suppress that file as we do not need to check and create the nut user and group for nut-cgi * debian/nut-cgi.postinst: enhanced to ensure the /etc/nut directory and nut-cgi configuration files are readable by others * debian/nut-cgi.README.Debian: improve the documentation about configuration files permissions -- Arnaud Quette Fri, 24 Feb 2006 10:05:25 +0100 nut (2.0.3-1) unstable; urgency=low * New upstream release - include the improved USB driver (closes: #300115) - fix mge-utalk regression (closes: #315431) - fix USB device claiming and logging (closes: #322901) * debian/nut-cgi.config: complete the typo fixes from 2.0.2-1 and remove exit calls (closes: #308215) * debian/nut.config: remove exit calls * debian/hotplug: add this file to manage hotplug and udev style permissions settings * debian/nut-usbups.rules: embed a modified version of the upstream file * debian/control: - make hotplug | udev Depends conditionnal, from rules - remove libusb-0.1-4 Depends as it is already listed with shlibs:Depends * debian/rules: - generate debian/control Depends for hotplug | udev - also install udev files (closes: #338738, #332939) - call the clean rule before distclean * debian/nut.README.Debian: - update the Installation §2 to reflect udev changes on serial port permissions. Users need to manually add the nut group to the dialout group (closes: #325878, #334105) - some other minor update -- Arnaud Quette Tue, 21 Feb 2006 13:57:35 +0100 nut (2.0.2-2) unstable; urgency=low * debian/nut-cgi.postinst: load confmodule * debian/nut-hidups/*: remove this unneeded directory * debian/control: - Update build dependency from libsnmp5-dev to libsnmp9-dev (closes: #326410) - Changes nut-usb wrong dependency from libusb-dev to libusb-0.1-4 (closes: #320315) - add debconf (>= 0.5.00) and adduser to nut/nut-cgi Depends * debian/copyright: update the FSF address and the Authors * debian/po/vi.po: add the Vietnamese translation for debconf, from Clytie Siddall ((closes: #316327) -- Arnaud Quette Fri, 07 Oct 2005 23:35:55 +0200 nut (2.0.2-1) unstable; urgency=low * New upstream release: - build respect LDFLAGS (closes: #265439) - fix etapro brokeness (closes: #305730) - fix shutdown/restart problems with mge-shut (closes: #302190) - fix mge-utalk support for older units (closes: #315431) * debian/po/fr.po: update the French debconf templates, thanks to Michel Grentzinger (closes: #306541) * debian/rules: - install hotplug files for the newhidups USB driver - suppress the snmp-ups.8 manpage workaround * debian/nut-usb.prerm: created to remove hotplug files * debian/control: - add hotplug Depends for nut-usb - upgrade Debian Policy to 3.6.2 * debian/patches/*: remove all patch and empty 00list as all has been fixed upstream * debian/nut-cgi.config: integrate the typo fixes that was blocking upgrade from woody to sarge * debian/nut-cgi.preinst: remove an unneeded blank line * acknowledge NMU from Craig Small (closes: #302189) -- Arnaud Quette Mon, 27 Jun 2005 11:29:52 +0200 nut (2.0.1-3) unstable; urgency=low * debian/patches/01_cleanSourceFromlibupsclient.dpatch: removed as it has been fixed upstream in 2.0.1 * debian/patches/00list: re enabled for the below patch * debian/patches/01_upsstatsCgiNoHostCrash.dpatch: added while waiting for the upstream fix (closes: #302902) * debian/nut-cgi.templates: added nut-cgi/major_template_changes * debian/nut-cgi.config: use nut-cgi/major_template_changes (closes: #301184) * debian/nut-cgi.README.Debian: reworked, and mention upgrade and installation. * debian/nut.README.Debian: mention the missing UPGRADING file, and complete the upsmon.conf lines with the mandatory POWERDOWNFLAG and SHUTDOWNCMD (closes: #302182) * debian/nut.templates: add nut/2_0_upstream_changes to deal with the new changes * debian/nut.config: use the above nut/2_0_upstream_changes (closes: #301060) -- Arnaud Quette Fri, 15 Apr 2005 13:52:32 +0100 nut (2.0.1-2.1) unstable; urgency=low * Non-maintainer upload * NUT nows powersdown Closes: #302189 -- Craig Small Thu, 7 Apr 2005 11:47:58 +1000 nut (2.0.1-2) unstable; urgency=low * debian/control: add missing Build-Depends for dpatch, thanks to Kurt Roeckx (closes: #298218) -- Arnaud Quette Mon, 07 Mar 2005 16:29:32 +0100 nut (2.0.1-1) unstable; urgency=low * New upstream release (closes: #247671, #283539) * debian/watch: update URL to match the current 2.0 stable tree * debian/rules: - change install-misc target to install-lib following the upstream rule name change - error reporting enhancements, thanks to Karl Shaul (inserted a set -e at the start of every for loop ; from Debian Policy §4.5). - workaround to include dummycons test driver and its manpage in nut-dev while waiting for an upstream rule - workaround to remove snmp-ups manpage from the nut package, to avoid a file conflict with nut-snmp, while waiting for an upstream rule - remove the workaround from 1.4.2-2 to suppress libupsclient.a and newhidups upon make clean - comment the "conf files workaround" as it's no more needed * debian/control: - add nut-dev to nut Suggests - complete nut-dev to include dummycons testing driver - add libusb (>= 0.1.8) nut-usb Depends to benefit of the kernel driver unbind feature (needed for USB models other than MGE UPSs) - suppress libgd1 from Build-Depends to fix a DebCheck warning, as it is listed in Section oldlibs * debian/nut.README.Debian: add a section "(3) /etc/nut/upsd.conf" and add references to sample config files and UPGRADING information (closes: #269485) * debian/nut.TODO.Debian: add this file to track planned and unfinished tasks * debian/nut-cgi.README.Debian: improve a bit the text * debian/nut.init: test powerdown flag (upsmon -K) and use the new upsdrvctl exit codes (thanks to Karl Shaul) * debian/po/cs.po: add Czech translation of debconf templates (patch from Miroslav Kure) (closes: #283225) * debian/patches: add basic infrastructure for dpatch -- Arnaud Quette Fri, 04 Mar 2005 11:40:13 +0100 nut (1.4.3-2) unstable; urgency=low * debian/control: add nut-dev package with NUT lib and headers (closes: #263937) * debian/rules: change install-misc for the above nut-dev. * debian/control: invert apache and httpd in nut-cgi Recommends to solve a lintian warning -- Arnaud Quette Sun, 08 Aug 2004 16:07:04 +0200 nut (1.4.3-1) unstable; urgency=low * New upstream release * debian/control: change Homepage URL to "www" instead of "random" and remove trailing slash / dot (closes: #254084) * debian/control: add apache to nut-cgi Recommends to have a non-virtual package alternative -- Arnaud Quette Thu, 29 Jul 2004 22:58:03 +0200 nut (1.4.2-3) unstable; urgency=low * debian/control: add libusb-dev version in Build-Depends (closes: #248952) * debian/copyright: update upstream URL and copyright owners (closes: #242422) * debian/po/ca.po: add Catalan translation of debconf templates (patch from Aleix Badia i Bosch) (closes: #248741) * debian/nut-cgi.README.Debian: added to describe nut-cgi configuration (thanks to Marius Gedminas) (closes: #249825) * debian/nut.README.Debian: minor change -- Arnaud Quette Fri, 28 May 2004 13:10:01 +0200 nut (1.4.2-2) unstable; urgency=low * debian/control: add libusb-dev to Build-Depends (closes: #240586) * debian/rules: workaround to clean libupsclient.a and newhidups (complete the above) -- Arnaud Quette Sun, 28 Mar 2004 18:30:01 +0100 nut (1.4.2-1) unstable; urgency=low * New upstream release * Fixes mge-shut settings and shutdown problems (closes: #232402, #234037) * debian/nut.init: fixes powerdown rule to prevent from forced UPS shutoff upon normal shutdown, and add a warning when POWERDOWN flags isn't defined, thanks to Loic Le Loarer (closes: #236092) * debian/control: update nut-usb Description to reflect the add of newhidups and energizerups drivers. * debian/rules: update nut-usb build and install rules to match the new ones -- Arnaud Quette Thu, 25 Mar 2004 16:30:01 +0100 nut (1.4.1-release-2) unstable; urgency=low * recall previously malformed closed bug (closes: #227965, #227964) * debian/control: Build-Depends to allow libgd*-noxpm (closes: #231153) * debian/control: update Homepage address * debian/watch: update target address -- Arnaud Quette Thu, 05 Feb 2004 19:19:56 +0100 nut (1.4.1-release-1) unstable; urgency=low * New upstream release * debian/po/*: add gettext support for debconf templates (patch from Michel Grentzinger) (Close: #227965) * debian/po/fr.po: add French translation of debconf templates (patch from Michel Grentzinger) (Close: #227964) -- Arnaud Quette Sun, 18 Jan 2004 21:19:56 +0100 nut (1.4.1-pre3-5) unstable; urgency=low * debian/nut.postrm: fix inverted test with -z (fix a purge error) * debian/nut.postrm: same as above * debian/nut.postrm: suppress check_and_delete_group() as it is not useful * debian/nut-cgi.postrm: same as above * debian/nut.postinst: test if /etc/nut exists before chmod'ing (fix an install error) -- Arnaud Quette Sat, 15 Nov 2003 22:10:23 +0100 nut (1.4.1-pre3-4) unstable; urgency=low * debian/nut.preinst: wider check for user/group creation (closes: #217980) * debian/nut.postrm: rework purge rule for user/group deletion (2nd part of the above fix) * debian/nut-cgi.postrm: rework purge rule for user/group deletion (2nd part of the above fix) * debian/nut-cgi.preinst: wider check for user/group creation (same as above) * debian/rules: suppress {nut,nut-cgi}/etc/nut/*.sample that were wrongly installed (linked to #172217) * debian/nut.examples: created to complete above fix * debian/nut-cgi.examples: created to complete above fix * debian/nut.postrm: suppress /etc/nut/*.sample file (to correct above problem) * debian/nut-cgi.postrm: suppress /etc/nut/*.sample file (same as above) * Maintainer upload (forgotten previously), closes: #200182, #203061 -- Arnaud Quette Sat, 15 Nov 2003 10:10:23 +0100 nut (1.4.1-pre3-3) unstable; urgency=low * clients/Makefile.in: install parseconf.h to fix compilation error with wmnut * man/Makefile.in: fix a broken upstream rule (hidups manpages installed two times) that prevent from installing nut-usb package. This will be fixed in the next upstream -- Arnaud Quette Mon, 10 Nov 2003 17:10:23 +0100 nut (1.4.1-pre3-2) unstable; urgency=low * man/Makefile.in: fix a broken upstream rule (powernet and snmp-ups manpages installed two times) that prevent from installing nut-snmp package -- Arnaud Quette Mon, 10 Nov 2003 12:59:23 +0100 nut (1.4.1-pre3-1) unstable; urgency=low * New upstream release * clients/Makefile.in: suppress the one line patch to install parseconf.o (from 1.4.1-pre2-1). This is now cleanly addressed by the upstream source by installing libupsclient.a (closes: #216496) * debian/rules: change dh_shlibdeps's exclude from upsfetch.o to libupsclient.a * debian/nut.preinst: fix install rule to catch all cases of nut user and group needed creation. Previously, post purge install case was not (closes: #217980) * debian/rules: suppress the work-around for nut-usb package following the upstream correction (from 1.4.1-pre1-2) * debian/control: Final package take over ; switch Luca Filipozzi as co maintainer, and Arnaud Quette as new maintainer. * debian/watch: point the authoritative download server (penguin.harrison) and stable releases ("nut/release/1.4/" directory ; it won't work for final 1.4.1, but for 1.4.2) * debian/nut.postrm: rework purge rule to suppress a warning -- Arnaud Quette Sat, 8 Nov 2003 12:15:23 +0100 nut (1.4.1-pre2-1) unstable; urgency=low * New upstream release * debian/control: created package nut-usb for finer deps management * debian/rules: added rules for nut-usb package, and a work-around for install directories creation while waiting for upstream correction. * drivers/Makefile.in: suppressed hidups from PROGS, thanks to the above * debian/control: repeat Homepage for every sub-package * debian/control: completed nut Suggests * debian/control: changed Arnaud Quette address to the good Debian one * debian/rules: suppress the work-around for nut-snmp package following the upstream correction(from 1.4.1-pre1-1) * debian/nut-cgi.preinst: always test if nut user exist as nut-cgi can be installed without nut, so not having nut user created (closes: Bug#213730) * debian/nut-cgi.postinst: chown root:nut to address a potential security issue (see 1.2.1-2) * clients/Makefile.in: one line patch to install parseconf.o. This solve a problem with wmnut package (can't build anymore due to unresolved symbols). This point will be more cleanly address in next upstream -- Arnaud Quette Sat, 18 Oct 2003 09:05:01 +0200 nut (1.4.1-pre1-2) unstable; urgency=low * debian/control: rewrotte descriptions to follow Debian Policy. A further enhancement will be to use debian/nut.substvars (thanks to Shaul Karl) (closes: Bug#209569) * drivers/Makefile.in: added back hidups to PROGS (closes: Bug#208248) * debian/control: added libgd2-* to Build-Depends to allow more choices * debian/control: added Shaul Karl as co-maintainer * debian/control: changed Arnaud Quette address to Debian's one -- Arnaud Quette Sun, 14 Sep 2003 12:11:45 +0200 nut (1.4.1-pre1-1) unstable; urgency=low * New upstream release (closes: Bug#203856) * recall ignored 1.4.0-2 changes (closes: Bug#204193, Bug#199895) * debian/nut.preinst: already solved bug in 1.4.0-3 (closes:Bug#206229) * debian/control: created package nut-snmp (closes: Bug#195645) * debian/rules: added rules for nut-snmp package, and a work-around for install directories creation while waiting for upstream correction. * debian/control: change Build-Depends to "libgd-xpm-dev | libgd-dev" to allow easy woody backport (thanks to Martin Maney) * debian/nut.prerm: wait for upsd stop before calling the remove tempo -- Arnaud Quette Sat, 23 Aug 2003 13:55:32 +0200 nut (1.4.0-3) unstable; urgency=low * debian/nut.prerm: fix a post removal warning by adding a tempo (1 sec) before removing /var/run/nut * debian/nut.preinst: reworked install rule (thanks Shaul) (closes:Bug#204153) -- Arnaud Quette Fri, 8 Aug 2003 23:14:26 +0200 nut (1.4.0-2) unstable; urgency=low * debian/watch: update URL to point NUT 1.4 (thanks to Shaul Karl) * debian/nut.dirs: add /var/run/nut (thanks Shaul) (closes: Bug#204193) * debian/nut-cgi.preinst: created for allowing separate installation (without nut) (closes: Bug#199895) * debian/rules: remove the "--with-group=nut" call to configure as it is obsolete (thanks Shaul) * debian/control: add Arnaud Quette as co-maintainer -- Arnaud Quette Thu, 7 Aug 2003 20:14:26 +0200 nut (1.4.0-1) unstable; urgency=low * New upstream release (closes: Bug#203061) * debian/nut.init: change Init-script ordering (start_stop_server) to address data stale warning (closes: Bug#200182) -- Arnaud Quette Fri, 1 Aug 2003 18:42:22 +0200 nut (1.2.2-1) unstable; urgency=low * New upstream release * debian/rules: gidNumber of group 'nobody' is 65534 not 65535 (thanks Shaul) (closes: Bug#180532) -- Luca Filipozzi Fri, 18 Apr 2003 20:12:17 -0700 nut (1.2.1-2) unstable; urgency=low * debian/nut.README.Debian: s/smartapc/apcsmart/ (closes: Bug#177713) * debian/nut.postinst: chown root:nut instead of chown nut:nut for files in /etc/nut/* and for the dirs /etc/nut, /var/run/nut, /var/lib/nut; this addresses a potential security issue as described in the comments contained in /etc/nut/upsmon.conf (closes: Bug#180059) * debian/nut.init: sysadmins might modify POWERDOWNFLAG in /etc/nut/upsmon.conf without realizing that it is hard coded in the /etc/init.d/nut init script; fix the init script to parse the configuration file for the value of POWERDOWNFLAG (closes: Bug#179686) * debian/nut.init: print a message prior to shutdown (closes: Bug#180242) -- Luca Filipozzi Sat, 8 Feb 2003 18:12:11 -0800 nut (1.2.1-1) unstable; urgency=low * New upstream release * debian/control: nut provides/conflicts ups-monitor (closes: Bug#170655) * debian/nut.postinst and debian/nut-cgi.postinst: test -f file before chown/chmod (closes: Bug#170553) * debian/nut.postinst: fix permissions on /var/lib/nut (closes: Bug#173318) * debian/nut.preinst: change how the 'nut' user/group are detected and created (closes: Bug#173321) * between 1.1.11-1 incorrectly installed conffiles into /etc/nut with the extension .sample; fortunately, this release of the package did not migrate to testing and since 1.1.11-2 the .sample extension has not been used (closes: Bug#172217) * debian/nut.preinst: change the way the nut user/group are detected before adduser is called (closes: Bug#170653) * debian/nut.README.Debian: fixed minor doc error (Closes: Bug#173673) -- Luca Filipozzi Wed, 11 Dec 2002 19:39:02 -0800 nut (1.2.0-1) unstable; urgency=low * New upstream release * debian/nut-cgi.postinst: fix permissions on /etc/nut/hosts.conf and /etc/nut/upsset.conf so that they are world readable (Closes: Bug#167332) * debian/nut.init: added sleep 5 to allow for an orderly restart (thanks to Shaul Karl for pointing this out) -- Luca Filipozzi Tue, 19 Nov 2002 09:44:25 -0800 nut (1.1.12-1) unstable; urgency=high * New upstream release (urgency high due to SECURITY FIX) * SECURITY FIX: a file permission problem potentially exposes non-system usernames/passwords in /etc/nut/upsd.users that can be used to DoS a machine running nut by contacting the nut daemon and instructing it to power off the machine; fixed. * debian/nut.postinst: change permissions of /etc/nut/upsd.users and other conffiles to 640 (Closes: Bug#165445) * debian/nut.config: use db_fset to reset the boolean question that prompts users to accept whether to continue with the installation of this version of nut should they answer no (Closes: Bug#165376) * debian/control: make nut-cgi Replace nut so that conflicting files can be installed (Closes: Bug#165049) * drivers/Makefile.in: restored original version that doesn't build hidups, snmp-ups or powernet; hidups doesn't build on m68k; snmp-ups and powernet require libsnmp5-dev but libsnmp5-dev requires OpenSSL; unfortunately, upstream's license doesn't have the OpenSSL exclusion clause... work is proceeding on porting to gnutls * drivers/Makefile.in + debian/rules: figured out a mechanism to build hidups on those architectures that have /usr/include/linux/hiddev.h * debian/control: build-depend on libgd-xpm-dev (really closes Bug#164832) -- Luca Filipozzi Sat, 19 Oct 2002 16:47:35 -0700 nut (1.1.11-2) unstable; urgency=low * changed build dependencies to avoid depending on a pure-virtual package without providing a default (thanks Junichi Uekawa) (Closes: Bug#164832) * debian/rules calls $(MAKE) install-misc so that the header and the .o file are released with the nut package (too small for a nut-dev package?) -- Luca Filipozzi Tue, 15 Oct 2002 08:50:18 -0700 nut (1.1.11-1) unstable; urgency=low * New upstream release (Closes: Bug#151047, Bug#155943, Bug#153174, Bug#160178, Bug#164024) * the "Hey Dorothy, you aren't in Kansas anymore" release * warning: significant changes since nut 0.45.5; specifically: - upsd listens on a different port (was 3305; now 3493 (IANA-assigned)) - configuration file formats have changed - ups driver internals haved changed: 'common main.c' + upsdrvctl - some ups drivers that were not ported to the new common model have been dropped by the upstream author (submit a patch to rectify) - the init script is significantly simpler - the daemons will NOT restart on upgrade from from 0.45.5 or earlier - there is an /etc/default/nut file that defines whether the daemons will be started - removed nut-doc package... far too small to merit being on its own -- Luca Filipozzi Mon, 14 Oct 2002 13:33:58 -0700 nut (0.45.5-rel-3) unstable; urgency=low * "unlink .sock file before starting up; this was keeping the drivers down after a system crash where the .sock files remained" -- upstream (Closes: Bug#149150, Bug#139859) -- Luca Filipozzi Fri, 7 Jun 2002 22:34:53 -0700 nut (0.45.5-rel-2) unstable; urgency=low * debian/control: nut and nut-cgi suggest rather than recommend the documentation package, nut-doc (Closes: Bug#144763) * debian/nut-cgi.dirs: change absolute paths to relative (Closes: Bug#144746) * debian/rules: remove upsdrvctl.8 from package (Closes: Bug#143099) -- Luca Filipozzi Sun, 2 Jun 2002 21:39:14 -0700 nut (0.45.5-rel-1) unstable; urgency=low * New upstream release * debian/rules: moved model daemons to /lib/nut to reduce chance of namespace conflicts (Closes: Bug#141209) * debian/rules: moved sample configuration files to /usr/share/doc/nut/examples (Closes: Bug#140472) # debian/postinst: change mode and ownership of files in /etc/nut/ on configure to allow ready by nut/nut (Closes: Bug#142116) -- Luca Filipozzi Sun, 14 Apr 2002 13:37:13 -0700 nut (0.45.4-rel-3) unstable; urgency=low * added runtime dependency on adduser (Closes: Bug#137887) -- Luca Filipozzi Sat, 16 Mar 2002 21:41:53 -0800 nut (0.45.4-rel-2) unstable; urgency=low * Changed debian/rules to call install-misc which installs the development files upsfetch.[oh]. There are too few development files to merit a nut-dev package. -- Luca Filipozzi Sun, 24 Feb 2002 15:47:56 -0800 nut (0.45.4-rel-1) unstable; urgency=low * New upstream release -- Luca Filipozzi Sun, 24 Feb 2002 11:56:46 -0800 nut (0.45.4-pre5-1) unstable; urgency=low * New upstream release (Closes: Bug#131673) -- Luca Filipozzi Sun, 17 Feb 2002 17:31:32 -0800 nut (0.45.1-release-2) unstable; urgency=low * applied POWERDOWNFLAG upstream-patch (Closes: Bug#111979) * applied apcsmart calibration user-patch (Closes: Bug#111978) * modified models/main.c so that it does a forceshutdown *before* attempting to chdir into /var/lib/nut (Closes: Bug#112540) -- Luca Filipozzi Tue, 23 Oct 2001 16:22:57 -0700 nut (0.45.1-release-1) unstable; urgency=low * New upstream release * Fixed conffile problem with nut-cgi package (Closes: #108687) -- Luca Filipozzi Sat, 18 Aug 2001 11:58:57 -0700 nut (0.45.1-pre4-1) unstable; urgency=low * New upstream release (Closes: #101105) -- Luca Filipozzi Sun, 5 Aug 2001 13:59:12 -0700 nut (0.44.3-pre6-3) unstable; urgency=low * Init script now poweroffs the UPS' correctly. (Closes: #96790) * Changed section of nut-doc to 'doc' (Closes: #94842) * Not upgrading to new upstream source (0.45.0) until it is released. * Not upgrading to upstream source (0.44.3) since (0.45.0) is coming soon. -- Luca Filipozzi Sun, 3 Jun 2001 16:05:01 -0700 nut (0.44.3-pre6-2) unstable; urgency=low * init script follows policy (Closes: #90346) -- Luca Filipozzi Mon, 19 Mar 2001 15:21:44 -0800 nut (0.44.3-pre6-1) unstable; urgency=low * New upstream release * modified configure.in so that it doesn't produce an error when it tests for the existance of group "nut" (Closes: #88126) -- Luca Filipozzi Sun, 11 Mar 2001 11:48:54 -0800 nut (0.44.3-pre4-1) unstable; urgency=low * New upstream release * create pidfile modifications reworked to use upstream's writepid() function * modified init script to support these changes... note that users MUST follow the convention for the UPS directives in the sample upsd.conf; a warning has been placed in said file -- Luca Filipozzi Sun, 25 Feb 2001 19:19:29 -0800 nut (0.44.2-6) unstable; urgency=low * modified prerm and postinst so that the daemon(s) is restarted only in the postinst rather than stopped in prerm and started later in postinst thereby stopping the daemon(s) shortest possible time (Closes: #83614) * modified all the daemon(s)' source code so that they create pidfiles * modified the init script so that it uses the pidfiles -- Luca Filipozzi Sun, 11 Feb 2001 18:23:44 -0800 nut (0.44.2-5) unstable; urgency=low * removed "function" keyword from init script (Closes: #83569) * modified the pre and post scripts so that #DEBHELPER# is at the bottom * modified debian/rules so that nut-doc is created (Closes: #85059) * added support for MGE UPS (thanks to Ryan Murray) (Closes: #83743) -- Luca Filipozzi Sat, 10 Feb 2001 20:09:35 -0800 nut (0.44.2-4) unstable; urgency=low * control file changed such that arch=any for nut-doc (Closes: #83323) -- Luca Filipozzi Tue, 23 Jan 2001 17:49:25 -0800 nut (0.44.2-3) unstable; urgency=low * Added a build conflict against libgd-gif1-dev because it provides libgd-dev but does not have PNG support. (Closes: #82607) * Fixed a path problem in debian/rules that had manpages installing in /share/man/man8 instead of /usr/share/man/man8. -- Luca Filipozzi Wed, 17 Jan 2001 19:11:56 -0800 nut (0.44.2-2) unstable; urgency=low * Modified README.Debian to address bad doc path (Closes: #82460) * Slight improvements to README.Debian, as well. -- Luca Filipozzi Mon, 15 Jan 2001 21:11:39 -0800 nut (0.44.2-1) unstable; urgency=low * New upstream release -- Luca Filipozzi Tue, 9 Jan 2001 08:33:56 -0800 nut (0.44.1-4) unstable; urgency=low * fixed path problem with cgi files; they *are* in /usr/lib/cgi-bin/nut now -- Luca Filipozzi Wed, 22 Nov 2000 08:47:54 -0800 nut (0.44.1-3) unstable; urgency=low * the following changes suggested by Patrik Rak (Closes: #77144, #77195) * added better preinst(install) checks for group membership * modified upstream upsd.conf to use correct paths in the UPS directives * modified upstream upsd.conf to have better ACCESS directive examples * modified upstream upsmon.conf to have better MONITOR directive examples * modified upstream upsmon.conf to use a different POWERDOWNFLAG location (location must be on the root filesystem... otherwise powerdownflag is not found!) * modified init script to parse upsmon.conf for the POWERDOWNFLAG location * modified init script's poweroff section so that all args are recognized * improved the documentation, primarily README.Debian * installation scripts modified so that the dependency on adduser >= 3.14 can be removed; this allows for the creation of potato packages * the nut user is no longer part of the dialout group; users will have to manually change the permissions on the serial port devices; a nut group is created at the same time as the nut user; users should use the nut group for the serial port permissions: chown root.nut /dev/ttyS0 (suggested by Shaul Karl and Patrik Rak) * the cgi scripts are moved to /usr/lib/cgi-bin/nut/* (suggested by Shaul Karl) * init script changed significantly to address argument passing problems (reported by Shaul Karl) -- Luca Filipozzi Thu, 16 Nov 2000 11:42:42 -0800 nut (0.44.1-2) unstable; urgency=low * removed else clause on detection of existing "nut" user (Closes: #76721) "install" creates the user nut; "remove" doesn't remove it, "purge" does; a re-"install" would find an existing "nut" user and exit on error; fixed * fixed a possible bashism (Closes: #72711) -- Luca Filipozzi Fri, 10 Nov 2000 10:06:05 -0800 nut (0.44.1-1) unstable; urgency=low * New upstream release * serious repurcussion to existing users of nut... the configuration files have changed somewhat... a critical debconf warning informs the user of this fact * binaries are to remains in /sbin (Closes: #69525) * init script no longer relies on /usr being mounted (Closes: #70033) * -- Luca Filipozzi Fri, 10 Nov 2000 10:05:55 -0800 nut (0.44.0-4) unstable; urgency=low * Moved man pages from section 1 to section 8. (Closes: #68819) * nut-doc suggest rather than recommends nut and nut-cgi. (Closes: #69400) -- Luca Filipozzi Fri, 18 Aug 2000 23:15:18 -0700 nut (0.44.0-3) unstable; urgency=low * Minor fixes to packaging scripts (Closes: #67649). * Created new doc package: nut-doc. -- Luca Filipozzi Mon, 24 Jul 2000 10:18:19 -0700 nut (0.44.0-2) unstable; urgency=low * Minor fixes to init script and to list of undocumented binaries. -- Luca Filipozzi Sat, 22 Jul 2000 19:11:42 -0700 nut (0.44.0-1) unstable; urgency=low * New upstream release -- Luca Filipozzi Thu, 20 Jul 2000 09:26:04 -0700 nut (0.43.2-2) unstable; urgency=low * fixes: Bug#67316: nut: default permissions could reveal passwords Files in /etc/nut are now 600 by default. * fixes: Bug#67314: nut: uses old FHS directory /var/state Now uses /var/lib as per FHS guidelines. * fixes: Bug#66988: nut_0.43.2-1(unstable): Missing build dependencies Added debhelper to the build dependencies. -- Luca Filipozzi Tue, 18 Jul 2000 14:55:03 -0700 nut (0.43.2-1) unstable; urgency=low * Initial Release. * Modification to upstream source: configure.in, common/common.c, and models/upscommon.c changed to support different configuration options... --with-user and --with-group which accept a username and a groupname (rather than a uid/gid as before). * Modification to upstream source: /var/state/nut is used instead of /var/state/ups in conf/upsd.conf. -- Luca Filipozzi Wed, 3 May 2000 20:50:30 -0700 Local variables: mode: debian-changelog End: debian/nut-xml.install0000644000000000000000000000003612244455113012162 0ustar debian/tmp/lib/nut/netxml-ups debian/libupsclient-dev.install0000644000000000000000000000035712244455113014035 0ustar usr/lib/*/libupsclient.so usr/lib/*/libupsclient.a usr/lib/*/pkgconfig/libupsclient.pc usr/include/nut-scan.h usr/include/nutscan-device.h usr/include/nutscan-init.h usr/include/nutscan-ip.h usr/include/parseconf.h usr/include/upsclient.h debian/python-nut.install0000644000000000000000000000006312244455113012703 0ustar scripts/python/module/PyNUT.py usr/share/pyshared/ debian/libupsclient3.install0000644000000000000000000000003012244455113013330 0ustar lib/*/libupsclient.so.* debian/nut-server.install0000644000000000000000000000332412260230776012677 0ustar debian/tmp/sbin/upsd debian/tmp/usr/share/apport/package-hooks/source_nut-server.py debian/tmp/usr/share/nut/cmdvartab debian/tmp/usr/share/nut/driver.list debian/tmp/*/udev/rules.d/52-nut-usbups.rules debian/tmp/etc/avahi/services/nut.service debian/tmp/etc/nut/ups.conf debian/tmp/etc/nut/upsd.conf debian/tmp/etc/nut/upsd.users debian/tmp/lib/nut/genericups debian/tmp/lib/nut/mge-shut debian/tmp/lib/nut/rhino debian/tmp/lib/nut/bestups debian/tmp/lib/nut/bestfortress debian/tmp/lib/nut/usbhid-ups debian/tmp/lib/nut/apcsmart debian/tmp/lib/nut/apcsmart-old debian/tmp/lib/nut/belkin debian/tmp/lib/nut/blazer_ser debian/tmp/lib/nut/blazer_usb debian/tmp/lib/nut/clone debian/tmp/lib/nut/clone-outlet debian/tmp/lib/nut/ivtscd debian/tmp/lib/nut/metasys debian/tmp/lib/nut/etapro debian/tmp/lib/nut/tripplite_usb debian/tmp/lib/nut/bcmxcp debian/tmp/lib/nut/bestuferrups debian/tmp/lib/nut/gamatronic debian/tmp/lib/nut/oldmge-shut debian/tmp/lib/nut/safenet debian/tmp/lib/nut/isbmex debian/tmp/lib/nut/masterguard debian/tmp/lib/nut/belkinunv debian/tmp/lib/nut/tripplite debian/tmp/lib/nut/upscode2 debian/tmp/lib/nut/solis debian/tmp/lib/nut/oneac debian/tmp/lib/nut/mge-utalk debian/tmp/lib/nut/powerpanel debian/tmp/lib/nut/bestfcom debian/tmp/lib/nut/liebert debian/tmp/lib/nut/powercom debian/tmp/lib/nut/bcmxcp_usb debian/tmp/lib/nut/victronups debian/tmp/lib/nut/tripplitesu debian/tmp/lib/nut/optiups debian/tmp/lib/nut/upsdrvctl /sbin debian/tmp/lib/nut/everups debian/tmp/lib/nut/dummy-ups debian/tmp/lib/nut/richcomm_usb debian/tmp/lib/nut/liebert-esp2 debian/tmp/lib/nut/microdowell debian/tmp/lib/nut/al175 debian/tmp/lib/nut/apcupsd-ups debian/tmp/lib/nut/nutdrv_qx debian/tmp/lib/nut/riello_ser debian/tmp/lib/nut/riello_usb debian/nut-cgi.postinst0000644000000000000000000000211412260230776012344 0ustar #!/bin/sh -e case "$1" in configure) # make sure the nut user exists and has correct memberships if ! getent group nut >/dev/null; then addgroup --quiet --system nut fi if ! getent passwd nut >/dev/null; then adduser --quiet --system --ingroup nut --home /var/lib/nut --no-create-home nut elif ! groups nut | grep -qw nut; then adduser nut nut fi # for Ubuntu, while waiting for a proper debconf if ! groups nut | grep -qw dialout; then adduser nut dialout fi # Ensure /etc/nut is readable/crossable for others if [ -d /etc/nut/ ] ; then chmod 755 /etc/nut fi # Ensure nut-cgi configuration files are readable by others for file in upsset.conf hosts.conf upsstats.html upsstats-single.html ; do if [ -f /etc/nut/$file ] ; then chmod 644 /etc/nut/$file fi done ;; abort-upgrade) # do nothing ;; abort-remove) # do nothing ;; abort-deconfigure) # do nothing ;; *) echo "$0: incorrect arguments: $*" >&2 exit 1 ;; esac #DEBHELPER# exit 0 debian/NEWS0000644000000000000000000000041312244455113007664 0ustar nut (2.6.5-1) experimental; urgency=low mge-shut driver has been replaced by a new implementation (newmge-shut). In case of issue with this new version, users can revert to oldmge-shut. -- Laurent Bigonville Mon, 13 Aug 2012 00:32:18 +0200 debian/nut-client.lintian-overrides0000644000000000000000000000017312244455113014632 0ustar nut-client: script-in-etc-init.d-not-registered-via-update-rc.d nut-client: systemd-no-service-for-init-script ups-monitor debian/hotplug0000644000000000000000000000075212244455113010600 0ustar #!/bin/bash # taken from libgphoto2 GROUP=nut # for previous udev versions if [ "$ACTION" = "add" ] && [ -f "$DEVICE" ] then # check if $GROUP really exists if getent group $GROUP > /dev/null; then chmod 660 "$DEVICE" chown root:$GROUP "$DEVICE" fi fi # for recent udev versions if [ "$ACTION" = "add" ] && [ -r "$DEVNAME" ] then # check if $GROUP really exists if getent group $GROUP > /dev/null; then chmod 660 "$DEVNAME" chown root:$GROUP "$DEVNAME" fi fi debian/nut-snmp.install0000644000000000000000000000003412244455113012335 0ustar debian/tmp/lib/nut/snmp-ups debian/libupsclient-dev.manpages0000644000000000000000000000012112244455113014147 0ustar debian/tmp/usr/share/man/man3/nutscan*.3 debian/tmp/usr/share/man/man3/upscli*.3 debian/nut.TODO.Debian0000644000000000000000000000072712244455113011653 0ustar - how to distribute the nut-scanner and its library? Ie, a single package, or using the nut-{xml,snmp,...} packages. this requires libusb (0.1), Net SNMP, FreeIPMi, Avahi, libupsclient and Neon! - consider an SSL/TLS set of packages (ie nut-ssl, ...) or help the port to NSS - install the device-recorder.sh script (with libupsclient-dev or a more generic nut-dev that depends?) - address the /var/www issue with upstream - audit and solve the lintian reports... debian/nut-doc.doc-base.nut-developer-guide0000644000000000000000000000076112244455113016026 0ustar Document: nut-developer-guide Title: Network UPS Tools Developer Guide Author: Russell Kroll, Arnaud Quette, Charles Lepple and Peter Selinger Abstract: This document intend to describe how NUT is designed, and the way to develop new device drivers and client applications. Section: Programming Format: PDF Files: /usr/share/doc/nut-doc/pdf/developer-guide.pdf Format: HTML Index: /usr/share/doc/nut-doc/html/developer-guide/index.html Files: /usr/share/doc/nut-doc/html/developer-guide/*.html debian/nut-ipmi.install0000644000000000000000000000011612244455113012317 0ustar debian/tmp/lib/nut/nut-ipmipsu debian/tmp/*/udev/rules.d/52-nut-ipmipsu.rules debian/nut.README.Debian0000644000000000000000000001450412244455113012041 0ustar Network UPS Tools - Quick Start for Debian ------------------------------------------ Anyway, here are the quick start instructions for using nut: These Quick Start instructions are useful for a UPS connected to a single machine. For a UPS connected to multiple machines, additional steps must be taken, as outlined at the end of this file, including the notice regarding SECURITY CONSIDERATIONS. (I) Upgrading ============= In case of upgrading, follow instructions given in: /usr/share/doc/nut/UPGRADING Note that service(s) (driver(s), upsd, upsmon) are not restarted upon upgrade, to avoid service disruption. You have to manually do it. (II) Installation ================= Configuration files are located in /etc/nut/ In order to tune NUT configuration according to your needs, follow the below information, along with the one provided inside these files. (1) /etc/nut/nut.conf (see 'man 5 nut.conf' for more information) Edit /etc/nut/nut.conf and modify the "MODE" variable according to your configuration. You can also fine tune the daemons options through UPSD_OPTIONS and UPSMON_OPTIONS. The steps 2 to 5 are only required if you use a "standalone" or "netserver" MODE. If you are running in "netclient" MODE, jump directly to section 6. (2) /etc/nut/ups.conf (see 'man 5 ups.conf' for more information) Edit /etc/nut/ups.conf and add something like: [myups] driver = usbhid-ups port = auto Use the appropriate driver for your UPS and select the correct port. To select the driver, take a look at the UPS compatibility list: /usr/share/nut/driver.list If you have more than one UPS, add as many entries as needed. If you wish to test manually whether your configuration of ups.conf is correct, you may invoke upsdrvctl by hand (as root): /sbin/upsdrvctl start [myups] /sbin/upsdrvctl stop [myups] Ensure that the permissions of ups.conf do not permit the world to read it. It should already be thus, but the following command accomplishes this: chown root:nut /etc/nut/ups.conf chmod 640 /etc/nut/ups.conf (3) device port permissions The nut user need to be able to access the device port both for reading and writing. For serial devices, there are two possibilities: a) You can add the nut user to the dialout group. The following command accomplishes this: addgroup nut dialout This is not done by default for security reason on Debian, but is applied on Ubuntu. b) Another solution, for system supporting udev, is to create a file, For example /etc/udev/rules.d/92-nut-serialups.rules. It will be used after /lib/udev/rules.d/91-permissions.rules, and contains something like: KERNEL=="ttyS1", GROUP="nut" where 'ttyS1' has to be replaced by the exact name of your serial port. For USB devices, permissions are automatically set by the /lib/udev/rules.d/52-nut-usbups.rules udev rules file. (4) /etc/nut/upsd.conf (see 'man 5 upsd.conf' for more information) the default /etc/nut/upsd.conf is fine for a "standalone" configuration. If you are in "netserver" MODE, you will have to modify the LISTEN option to something suitable. Ensure that the permissions of upsd.conf do not permit the world to read it. It should already be thus, but the following command accomplishes this: chown root:nut /etc/nut/upsd.conf chmod 640 /etc/nut/upsd.conf (5) /etc/nut/upsd.users (see 'man 5 upsd.users' for more information) Edit /etc/nut/upsd.users and add something like the following, without the comments, in order to define a user: [monmaster] password = blah upsmon master Please use *different* usernames and passwords than you use on your system; see the note regarding SECURITY CONSIDERATIONS at the end of this file. Ensure that the permissions of upsd.users do not permit the world to read it. It should already be thus, but the following command accomplishes this: chown root:nut /etc/nut/upsd.users chmod 640 /etc/nut/upsd.users (6) /etc/nut/upsmon.conf (see 'man 5 upsmon.conf' for more information) Edit /etc/nut/upsmon.conf and add something like the following: MONITOR myups@localhost 1 monmaster blah master POWERDOWNFLAG /etc/killpower SHUTDOWNCMD "/sbin/shutdown -h +0" Ensure that the permissions of upsmon.conf do not permit the world to read it. It should already be thus, but the following commands accomplishes this: chown root:nut /etc/nut/upsmon.conf chmod 640 /etc/nut/upsmon.conf (7) /etc/default/nut This file is not used anymore. nut.conf provides all the needed features to replace this file. (8) start the daemon If you use a "standalone" or "netserver" MODE, invoke: - '/etc/init.d/nut-server start' to start upsd and appropriate driver(s), - '/etc/init.d/nut-client start' to start upsmon. If you are running in "netclient" MODE, invoke: - '/etc/init.d/nut-client start' to start upsmon. Check /var/log/syslog to ensure that daemon(s) started up correctly. Additional Notes for Sharing a UPS ---------------------------------- If you have multiple machines connected to the same UPS, you will need to (a) modify the access control lists in upsd.conf on the server; (b) add additional users to upsd.users on the server; and (c) configure upsmon.conf on the clients. Please note that upsmon on a client machine and upsd on a server machine need to communicate via your network. This means that you need to ensure that all the networking equipment (hub, switch, router, etc.) between the client and the server is powered by the UPS. Otherwise, when the power goes down, the network connection between the client machine will be broken and the client will not be told to shut down. SECURITY CONSIDERATIONS ----------------------- Finally, please be aware of the following SECURITY CONSIDERATIONS: the TCP communications between the client daemon, upsmon, and the server daemon, upsd, send the username and passwords defined in upsd.users and used in upsmon.conf over the wire UNENCRYPTED. This means that somebody could sniff the username and password. A version that encrypts the connection using SSL should be available someday. Please see the documentation in /usr/share/doc/nut/docs for more information. debian/compat0000644000000000000000000000000212244455113010365 0ustar 8 debian/nut-client.manpages0000644000000000000000000000055412244455113012772 0ustar debian/tmp/usr/share/man/man8/upsc.8 debian/tmp/usr/share/man/man8/upscmd.8 debian/tmp/usr/share/man/man8/upsmon.8 debian/tmp/usr/share/man/man8/upsrw.8 debian/tmp/usr/share/man/man8/upssched.8 debian/tmp/usr/share/man/man5/nut.conf.5 debian/tmp/usr/share/man/man5/upsmon.conf.5 debian/tmp/usr/share/man/man5/upssched.conf.5 debian/tmp/usr/share/man/man8/upslog.8 debian/nut.install0000644000000000000000000000007012260230776011366 0ustar debian/tmp/usr/share/apport/package-hooks/source_nut.py debian/libupsclient3.symbols0000644000000000000000000000134612244455113013365 0ustar libupsclient.so.3 libupsclient3 #MINVER# pconf_char@Base 2.7.1 pconf_encode@Base 2.7.1 pconf_file_begin@Base 2.7.1 pconf_file_next@Base 2.7.1 pconf_finish@Base 2.7.1 pconf_init@Base 2.7.1 pconf_line@Base 2.7.1 pconf_parse_error@Base 2.7.1 upscli_add_host_cert@Base 2.7.1 upscli_cleanup@Base 2.7.1 upscli_connect@Base 2.7.1 upscli_disconnect@Base 2.7.1 upscli_errlist@Base 2.7.1 upscli_fd@Base 2.7.1 upscli_get@Base 2.7.1 upscli_init@Base 2.7.1 upscli_list_next@Base 2.7.1 upscli_list_start@Base 2.7.1 upscli_readline@Base 2.7.1 upscli_sendline@Base 2.7.1 upscli_splitaddr@Base 2.7.1 upscli_splitname@Base 2.7.1 upscli_ssl@Base 2.7.1 upscli_strerror@Base 2.7.1 upscli_upserror@Base 2.7.1 upscli_tryconnect@Base 2.7.1 debian/Makefile.in0000644000000000000000000002515212244455113011241 0ustar # Makefile.in generated by automake 1.10.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = packaging/debian DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/nut_arg_with.m4 \ $(top_srcdir)/m4/nut_check_hiddev.m4 \ $(top_srcdir)/m4/nut_check_ipv6.m4 \ $(top_srcdir)/m4/nut_check_libgd.m4 \ $(top_srcdir)/m4/nut_check_libhal.m4 \ $(top_srcdir)/m4/nut_check_libneon.m4 \ $(top_srcdir)/m4/nut_check_libnetsnmp.m4 \ $(top_srcdir)/m4/nut_check_libssl.m4 \ $(top_srcdir)/m4/nut_check_libusb.m4 \ $(top_srcdir)/m4/nut_report_feature.m4 \ $(top_srcdir)/m4/nut_type_socklen_t.m4 \ $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONFPATH = @CONFPATH@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DRIVER_BUILD_LIST = @DRIVER_BUILD_LIST@ DRIVER_INSTALL_TARGET = @DRIVER_INSTALL_TARGET@ DRIVER_MAN_LIST = @DRIVER_MAN_LIST@ DSYMUTIL = @DSYMUTIL@ ECHO = @ECHO@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ FFLAGS = @FFLAGS@ GREP = @GREP@ HAL_CALLOUTS_PATH = @HAL_CALLOUTS_PATH@ HAL_FDI_PATH = @HAL_FDI_PATH@ HAL_USER = @HAL_USER@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBGD_CFLAGS = @LIBGD_CFLAGS@ LIBGD_LDFLAGS = @LIBGD_LDFLAGS@ LIBHAL_CFLAGS = @LIBHAL_CFLAGS@ LIBHAL_LDFLAGS = @LIBHAL_LDFLAGS@ LIBNEON_CFLAGS = @LIBNEON_CFLAGS@ LIBNEON_LDFLAGS = @LIBNEON_LDFLAGS@ LIBNETSNMP_CFLAGS = @LIBNETSNMP_CFLAGS@ LIBNETSNMP_LDFLAGS = @LIBNETSNMP_LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBSSL_CFLAGS = @LIBSSL_CFLAGS@ LIBSSL_LDFLAGS = @LIBSSL_LDFLAGS@ LIBTOOL = @LIBTOOL@ LIBUSB_CFLAGS = @LIBUSB_CFLAGS@ LIBUSB_LDFLAGS = @LIBUSB_LDFLAGS@ LINUX_HIDDEV = @LINUX_HIDDEV@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ NETLIBS = @NETLIBS@ NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ RUN_AS_GROUP = @RUN_AS_GROUP@ RUN_AS_USER = @RUN_AS_USER@ SED = @SED@ SERLIBS = @SERLIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STATEPATH = @STATEPATH@ STRIP = @STRIP@ SUN_LIBUSB = @SUN_LIBUSB@ VERSION = @VERSION@ WORDS_BIGENDIAN = @WORDS_BIGENDIAN@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ cgiexecdir = @cgiexecdir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ driverexecdir = @driverexecdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ hotplugdir = @hotplugdir@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigdir = @pkgconfigdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ udevdir = @udevdir@ EXTRA_DIST = changelog control copyright description.subst hotplug \ nut-cgi.config nut-cgi.docs nut-cgi.examples nut-cgi.postinst nut-cgi.postrm \ nut-cgi.preinst nut-cgi.README.Debian nut-cgi.templates nut.config \ nut.default nut.dirs nut.docs nut.examples nut-hal-drivers.docs \ nut.init nut.links nut.postinst nut.postrm nut.preinst nut.prerm \ nut.README.Debian nut.templates nut.TODO.Debian \ rules watch po/ca.po po/cs.po po/de.po po/fr.po po/POTFILES.in \ po/pt.po po/pt_BR.po po/templates.pot po/vi.po all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu packaging/debian/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu packaging/debian/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: debian/nut-client.maintscript0000644000000000000000000000006012244455113013524 0ustar rm_conffile /etc/bash_completion.d/nut 2.7.1-1~ debian/patches/0000755000000000000000000000000012260241563010616 5ustar debian/patches/0007-killpower-path.patch0000644000000000000000000000061512244455113015167 0ustar --- a/conf/upsmon.conf.sample.in +++ b/conf/upsmon.conf.sample.in @@ -196,7 +196,7 @@ DEADTIME 15 # # See the shutdown.txt file in the docs subdirectory for more information. -POWERDOWNFLAG @CONFPATH@/killpower +POWERDOWNFLAG /etc/killpower # -------------------------------------------------------------------------- # NOTIFYMSG - change messages sent by upsmon when certain events occur debian/patches/0005-Provide-retry-options-for-upsdrvctl-and-drivers.patch0000644000000000000000000001014412244455113023511 0ustar From ad1e78a22dc91b70bee871425cd5f74bb3c34c9f Mon Sep 17 00:00:00 2001 From: Laurent Bigonville Date: Thu, 21 Nov 2013 17:52:16 +0100 Subject: [PATCH] Provide retry options for upsdrvctl and driver(s) As recently seen in Debian (bugs #694717 and #677143), it may be required to have upsdrvctl retrying to start the driver in case of failure. More specifically, a mix of init system (V and systemd), udev and USB device(s) can result in the /dev entry not being available at driver startup, thus resulting in a general failure to start NUT. This commit provides at least a way to overcome this issue. A more suitable solution will require more work on NUT design. This patch if based on Arnaud Quette proposal --- docs/man/ups.conf.txt | 15 +++++++++++++++ docs/man/upsdrvctl.txt | 3 ++- drivers/upsdrvctl.c | 37 ++++++++++++++++++++++++++++++++++--- 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/docs/man/ups.conf.txt b/docs/man/ups.conf.txt index 8a72a83..4877852 100644 --- a/docs/man/ups.conf.txt +++ b/docs/man/ups.conf.txt @@ -58,6 +58,21 @@ directory, which is often /usr/local/ups/bin. Optional. Same as the UPS field of the same name, but this is the default for UPSes that don't have the field. +*maxretry*:: +Optional. Specify the number of attempts to start the driver(s), in case of +failure, before giving up. A delay of 'retrydelay' is inserted between each +attempt. Caution should be taken when using this option, since it can +impact the time taken by your system to start. ++ +The default is 1 attempt. + +*retrydelay*:: +Optional. Specify the delay between each restart attempt of the driver(s), +as specified by 'maxretry'. Caution should be taken when using this option, +since it can impact the time taken by your system to start. ++ +The default is 5 seconds. + *pollinterval*:: Optional. The status of the UPS will be refreshed after a maximum diff --git a/docs/man/upsdrvctl.txt b/docs/man/upsdrvctl.txt index f19fd77..52e5509 100644 --- a/docs/man/upsdrvctl.txt +++ b/docs/man/upsdrvctl.txt @@ -63,7 +63,8 @@ Without that argument, they operate on every UPS that is currently configured. *start*:: -Start the UPS driver(s). +Start the UPS driver(s). In case of failure, further attempts may be executed +by using the 'maxretry' and 'retrydelay' options - see linkman:ups.conf[5]. *stop*:: Stop the UPS driver(s). diff --git a/drivers/upsdrvctl.c b/drivers/upsdrvctl.c index 623f753..0cdaa2c 100644 --- a/drivers/upsdrvctl.c +++ b/drivers/upsdrvctl.c @@ -45,6 +45,12 @@ /* timer - keeps us from getting stuck if a driver hangs */ static int maxstartdelay = 45; + /* counter - retry that many time(s) to start the driver if it fails to */ +static int maxretry = 1; + + /* timer - delay between each restart attempt of the driver(s) */ +static int retrydelay = 5; + /* Directory where driver executables live */ static char *driverpath = NULL; @@ -65,6 +71,12 @@ void do_upsconf_args(char *upsname, char *var, char *val) driverpath = xstrdup(val); } + if (!strcmp(var, "maxretry")) + maxretry = atoi(val); + + if (!strcmp(var, "retrydelay")) + retrydelay = atoi(val); + /* ignore anything else - it's probably for main */ return; @@ -248,6 +260,7 @@ static void start_driver(const ups_t *ups) char *argv[8]; char dfn[SMALLBUF]; int ret, arg = 0; + int initial_exec_error = exec_error, drv_maxretry = maxretry; struct stat fs; upsdebugx(1, "Starting UPS: %s", ups->upsname); @@ -276,10 +289,28 @@ static void start_driver(const ups_t *ups) /* tie it off */ argv[arg++] = NULL; - debugcmdline(2, "exec: ", argv); - if (!testmode) { - forkexec(argv, ups); + while (drv_maxretry > 0) { + int cur_exec_error = exec_error; + + upsdebugx(2, "%i remaining attempts", drv_maxretry); + debugcmdline(2, "exec: ", argv); + drv_maxretry--; + + if (!testmode) { + forkexec(argv, ups); + } + + /* driver command succeeded */ + if (cur_exec_error == exec_error) { + drv_maxretry = 0; + exec_error = initial_exec_error; + } + else { + /* otherwise, retry if still needed */ + if (drv_maxretry > 0) + sleep (retrydelay); + } } } -- 1.8.4 debian/patches/0004-fix-systemd-service.patch0000644000000000000000000000203712244455113016134 0ustar Subject: Fix systemd service file for Debian From: Laurent Bigonville Forwarded: not-needed --- a/scripts/systemd/nut-driver.service.in +++ b/scripts/systemd/nut-driver.service.in @@ -1,10 +1,11 @@ [Unit] Description=Network UPS Tools - power device driver controller -After=local-fs.target network.target +After=local-fs.target network.target systemd-udev-settle.service +Wants=systemd-udev-settle.service StopWhenUnneeded=yes [Service] -ExecStart=@DRVPATH@/upsdrvctl start -ExecStop=@DRVPATH@/upsdrvctl stop +ExecStart=@SBINDIR@/upsdrvctl start +ExecStop=@SBINDIR@/upsdrvctl stop Type=forking --- a/scripts/systemd/nut-monitor.service.in +++ b/scripts/systemd/nut-monitor.service.in @@ -9,3 +9,4 @@ Type=forking [Install] WantedBy=multi-user.target +Alias=nut-client.service --- a/scripts/systemd/nutshutdown.in +++ b/scripts/systemd/nutshutdown.in @@ -1,2 +1,2 @@ #!/bin/sh -@SBINDIR@/upsmon -K >/dev/null 2>&1 && @driverexecdir@/upsdrvctl shutdown +@SBINDIR@/upsmon -K >/dev/null 2>&1 && @SBINDIR@/upsdrvctl shutdown debian/patches/backport-fix-lp753661.patch0000644000000000000000000000203112260241051015321 0ustar Description: Trim extraneous end-of-line, in buggy HID string tables Trim extraneous end-of-line, in buggy HID string tables, which results in upsc breaking the communication pipe. . this would be expected to be included in next nut upstream package (greater than 2.6.0) Applied-Upstream: http://trac.networkupstools.org/projects/nut/changeset/2972 Bug: https://bugs.launchpad.net/bugs/753661 Author: Arnaud Quette Last-Update: 2011-05-27 Index: b/drivers/libhid.c =================================================================== --- a/drivers/libhid.c +++ b/drivers/libhid.c @@ -400,8 +400,18 @@ */ char *HIDGetIndexString(hid_dev_handle_t udev, const int Index, char *buf, size_t buflen) { - if (comm_driver->get_string(udev, Index, buf, buflen) < 1) + char *ptr = NULL; + + if (comm_driver->get_string(udev, Index, buf, buflen) < 1) + { buf[0] = '\0'; + } + else + { + /* Check for extraneous end-of-line */ + if( (ptr = strchr(buf, '\n')) != NULL) + *ptr = '\0'; + } return rtrim(buf, '\n'); } debian/patches/0006-ups-conf-maxretry.patch0000644000000000000000000000240612244455113015627 0ustar --- a/conf/ups.conf.sample +++ b/conf/ups.conf.sample @@ -40,6 +40,24 @@ # # Configuration directives # ------------------------ +# +# These directives are used by upsdrvctl only and should be specified outside +# of a driver definition: +# +# maxretry: Optional. Specify the number of attempts to start the driver(s), +# in case of failure, before giving up. A delay of 'retrydelay' is +# inserted between each attempt. Caution should be taken when using +# this option, since it can impact the time taken by your system to +# start. +# +# The default is 1 attempt. +# +# retrydelay: Optional. Specify the delay between each restart attempt of the +# driver(s), as specified by 'maxretry'. Caution should be taken +# when using this option, since it can impact the time taken by your +# system to start. +# +# The default is 5 seconds. # # These directives are common to all drivers that support ups.conf: # @@ -102,3 +120,6 @@ # # To find out if your driver supports any extra settings, start it with # the -h option and/or read the driver's documentation. + +# Set maxretry to 3 by default, this should mitigate race with slow devices: +maxretry = 3 debian/patches/ppc64el.diff0000644000000000000000000000235012260241403012716 0ustar Index: b/configure =================================================================== --- a/configure +++ b/configure @@ -14149,7 +14149,10 @@ ;; esac ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -14168,7 +14171,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) Index: b/m4/libtool.m4 =================================================================== --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -1333,7 +1333,10 @@ ;; esac ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -1352,7 +1355,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) debian/patches/0002-nut-monitor-paths.patch0000644000000000000000000000551112244455113015630 0ustar --- a/scripts/python/app/NUT-Monitor +++ b/scripts/python/app/NUT-Monitor @@ -70,7 +70,7 @@ ( cmd_opts, args ) = opt_parser.parse_args() - self.__glade_file = os.path.join( os.path.dirname( sys.argv[0] ), "gui-1.3.glade" ) + self.__glade_file = '/usr/share/nut-monitor/gui-1.3.glade' self.__widgets["interface"] = gtk.glade.XML( self.__glade_file, "window1", APP ) self.__widgets["main_window"] = self.__widgets["interface"].get_widget("window1") @@ -103,11 +103,11 @@ # Create the tray icon and connect it to the show/hide method... self.__widgets["status_icon"] = gtk.StatusIcon() - self.__widgets["status_icon"].set_from_file( os.path.join( os.path.dirname( sys.argv[0] ), "pixmaps", "on_line.png" ) ) + self.__widgets["status_icon"].set_from_file( "/usr/share/nut-monitor/pixmaps/on_line.png" ) self.__widgets["status_icon"].set_visible( True ) self.__widgets["status_icon"].connect( "activate", self.tray_activated ) - self.__widgets["ups_status_image"].set_from_file( os.path.join( os.path.dirname( sys.argv[0] ), "pixmaps", "on_line.png" ) ) + self.__widgets["ups_status_image"].set_from_file( "/usr/share/nut-monitor/pixmaps/on_line.png" ) # Define interface callbacks actions self.__callbacks = { "on_window1_destroy" : self.quit, @@ -265,8 +265,8 @@ #------------------------------------------------------------------- # Change the status icon and tray icon def change_status_icon( self, icon="on_line", blink=False ) : - self.__widgets["status_icon"].set_from_file( os.path.join( os.path.dirname( sys.argv[0] ), "pixmaps", "%s.png" % icon ) ) - self.__widgets["ups_status_image"].set_from_file( os.path.join( os.path.dirname( sys.argv[0] ), "pixmaps", "%s.png" % icon ) ) + self.__widgets["status_icon"].set_from_file( "/usr/share/nut-monitor/pixmaps/%s.png" % icon ) + self.__widgets["ups_status_image"].set_from_file( "/usr/share/nut-monitor/pixmaps/%s.png" % icon ) self.__widgets["status_icon"].set_blinking( blink ) #------------------------------------------------------------------- @@ -719,9 +719,9 @@ for k,v in vars.iteritems() : if ( rwvars.has_key( k ) ) : - icon_file = os.path.join( os.path.dirname( sys.argv[0] ), "pixmaps", "var-rw.png" ) + icon_file = "/usr/share/nut-monitor/pixmaps/var-rw.png" else : - icon_file = os.path.join( os.path.dirname( sys.argv[0] ), "pixmaps", "var-ro.png" ) + icon_file = "/usr/share/nut-monitor/pixmaps/var-ro.png" icon = gtk.gdk.pixbuf_new_from_file( icon_file ) self.__widgets["ups_vars_tree_store"].append( [ icon, k, v ] ) debian/patches/0003-install-dev-files-in-usr.patch0000644000000000000000000000073612244455113016762 0ustar Description: Adjust .pc paths to install development files to /usr Author: Laurent Bigonville Forwarded: not-needed --- a/lib/libnutscan.pc.in +++ b/lib/libnutscan.pc.in @@ -1,4 +1,4 @@ -prefix=@prefix@ +prefix=/usr exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ --- a/lib/libupsclient.pc.in +++ b/lib/libupsclient.pc.in @@ -1,4 +1,4 @@ -prefix=@prefix@ +prefix=/usr exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ debian/patches/link-fixes.diff0000644000000000000000000001050412260241563013521 0ustar Index: b/clients/Makefile.am =================================================================== --- a/clients/Makefile.am +++ b/clients/Makefile.am @@ -46,7 +46,7 @@ # not LDADD. libupsclient_la_SOURCES = upsclient.c upsclient.h -libupsclient_la_LIBADD = ../common/libparseconf.la +libupsclient_la_LIBADD = ../common/libcommonclient.la if WITH_SSL libupsclient_la_LIBADD += $(LIBSSL_LIBS) endif Index: b/clients/Makefile.in =================================================================== --- a/clients/Makefile.in +++ b/clients/Makefile.in @@ -445,7 +445,7 @@ # not LDADD. libupsclient_la_SOURCES = upsclient.c upsclient.h -libupsclient_la_LIBADD = ../common/libparseconf.la $(am__append_4) +libupsclient_la_LIBADD = ../common/libcommonclient.la $(am__append_4) # libupsclient version information # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html Index: b/common/Makefile.am =================================================================== --- a/common/Makefile.am +++ b/common/Makefile.am @@ -2,7 +2,7 @@ AM_CFLAGS = -I$(top_srcdir)/include -noinst_LTLIBRARIES = libparseconf.la libcommon.la +noinst_LTLIBRARIES = libparseconf.la libcommon.la libcommonclient.la libparseconf_la_SOURCES = parseconf.c # do not hard depend on '../include/nut_version.h', since it blocks @@ -10,6 +10,8 @@ # BUILT_SOURCES (in ../include) will ensure nut_version.h will # be built before anything else libcommon_la_SOURCES = common.c state.c upsconf.c +libcommonclient_la_SOURCES = common.c state.c # ensure inclusion of local implementation of missing systems functions # using LTLIBOBJS. Refer to configure.in -> AC_REPLACE_FUNCS libcommon_la_LIBADD = libparseconf.la @LTLIBOBJS@ +libcommonclient_la_LIBADD = libparseconf.la @LTLIBOBJS@ Index: b/common/Makefile.in =================================================================== --- a/common/Makefile.in +++ b/common/Makefile.in @@ -91,6 +91,9 @@ libcommon_la_DEPENDENCIES = libparseconf.la @LTLIBOBJS@ am_libcommon_la_OBJECTS = common.lo state.lo upsconf.lo libcommon_la_OBJECTS = $(am_libcommon_la_OBJECTS) +libcommonclient_la_DEPENDENCIES = libparseconf.la @LTLIBOBJS@ +am_libcommonclient_la_OBJECTS = common.lo state.lo +libcommonclient_la_OBJECTS = $(am_libcommonclient_la_OBJECTS) libparseconf_la_LIBADD = am_libparseconf_la_OBJECTS = parseconf.lo libparseconf_la_OBJECTS = $(am_libparseconf_la_OBJECTS) @@ -107,8 +110,10 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(libcommon_la_SOURCES) $(libparseconf_la_SOURCES) -DIST_SOURCES = $(libcommon_la_SOURCES) $(libparseconf_la_SOURCES) +SOURCES = $(libcommon_la_SOURCES) $(libcommonclient_la_SOURCES) \ + $(libparseconf_la_SOURCES) +DIST_SOURCES = $(libcommon_la_SOURCES) $(libcommonclient_la_SOURCES) \ + $(libparseconf_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -303,7 +308,7 @@ top_srcdir = @top_srcdir@ udevdir = @udevdir@ AM_CFLAGS = -I$(top_srcdir)/include -noinst_LTLIBRARIES = libparseconf.la libcommon.la +noinst_LTLIBRARIES = libparseconf.la libcommon.la libcommonclient.la libparseconf_la_SOURCES = parseconf.c # do not hard depend on '../include/nut_version.h', since it blocks @@ -311,9 +316,11 @@ # BUILT_SOURCES (in ../include) will ensure nut_version.h will # be built before anything else libcommon_la_SOURCES = common.c state.c upsconf.c +libcommonclient_la_SOURCES = common.c state.c # ensure inclusion of local implementation of missing systems functions # using LTLIBOBJS. Refer to configure.in -> AC_REPLACE_FUNCS libcommon_la_LIBADD = libparseconf.la @LTLIBOBJS@ +libcommonclient_la_LIBADD = libparseconf.la @LTLIBOBJS@ all: all-am .SUFFIXES: @@ -359,6 +366,8 @@ done libcommon.la: $(libcommon_la_OBJECTS) $(libcommon_la_DEPENDENCIES) $(EXTRA_libcommon_la_DEPENDENCIES) $(LINK) $(libcommon_la_OBJECTS) $(libcommon_la_LIBADD) $(LIBS) +libcommonclient.la: $(libcommonclient_la_OBJECTS) $(libcommonclient_la_DEPENDENCIES) $(EXTRA_libcommonclient_la_DEPENDENCIES) + $(LINK) $(libcommonclient_la_OBJECTS) $(libcommonclient_la_LIBADD) $(LIBS) libparseconf.la: $(libparseconf_la_OBJECTS) $(libparseconf_la_DEPENDENCIES) $(EXTRA_libparseconf_la_DEPENDENCIES) $(LINK) $(libparseconf_la_OBJECTS) $(libparseconf_la_LIBADD) $(LIBS) debian/patches/series0000644000000000000000000000041312260241347012031 0ustar 0003-install-dev-files-in-usr.patch 0002-nut-monitor-paths.patch 0004-fix-systemd-service.patch 0005-Provide-retry-options-for-upsdrvctl-and-drivers.patch 0006-ups-conf-maxretry.patch 0007-killpower-path.patch backport-fix-lp753661.patch link-fixes.diff ppc64el.diff debian/nut-doc.doc-base.nut-packager-guide0000644000000000000000000000105712244455113015615 0ustar Document: nut-packager-guide Title: NUT Packager and Integrators Guide Author: Arnaud Quette Abstract: Packaging is a final aim for software. It eases and completes the software integration into an OS, and allows users to have an easy software installation and support out of the box. This document describes best practice for packaging NUT. Section: Debian Format: PDF Files: /usr/share/doc/nut-doc/pdf/packager-guide.pdf Format: HTML Index: /usr/share/doc/nut-doc/html/packager-guide/index.html Files: /usr/share/doc/nut-doc/html/packager-guide/*.html debian/nut-client.init0000755000000000000000000001233112244455113012141 0ustar #! /bin/sh ### BEGIN INIT INFO # Provides: nut-client upsmon ups-monitor # Required-Start: $local_fs $syslog $network $remote_fs # Required-Stop: $local_fs $syslog $network $remote_fs # Should-Start: nut-server # Should-Stop: # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Network UPS Tools monitor initscript # Description: This script take care of starting and stopping the # Network UPS Tools monitoring component (upsmon). ### END INIT INFO # Author: Arnaud Quette PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin NAME=nut-client DESC="NUT - power device monitor and shutdown controller" CONFIG=/etc/nut/nut.conf pid_dir=/var/run/nut upsmon_pid=${pid_dir}/upsmon.pid upsmon=/sbin/upsmon log=">/dev/null 2>/dev/null" # Define LSB log_* functions. # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. . /lib/lsb/init-functions # set upsmon specific options. use "man upsmon" for more info # this parameter is now located in nut.conf, and not in /etc/default/nut anymore # FIXME: retrieved from 'nut' script during update UPSMON_OPTIONS="" # Exit if the package is not installed [ -x "$upsmon" ] || exit 0 # Include NUT nut.conf [ -r $CONFIG ] && . $CONFIG # FIXME: put all common bits, between nut-client and nut-server, # into a common nut-function # Explicitly require the configuration to be done in /etc/nut/nut.conf if [ "x$MODE" = "xnone" -o -z "$MODE" ] ; then log_action_msg "$NAME disabled, please adjust the configuration to your needs" log_action_msg "Then set MODE to a suitable value in $CONFIG to enable it" # exit success to avoid breaking the install process! exit 0 fi # Check if /var/run/nut exists and has the correct perms check_var_directory() { [ ! -d ${pid_dir} ] && mkdir -p ${pid_dir} \ && chown root:nut ${pid_dir} \ && chmod 770 ${pid_dir} \ && [ -x /sbin/restorecon ] && /sbin/restorecon ${pid_dir} } # check if the right components are running check_status() { case "$MODE" in standalone|netserver|netclient) status_of_proc -p $upsmon_pid $upsmon upsmon ;; none|*) ;; esac } start_stop_client () { case "$MODE" in standalone|netserver|netclient) # FIXME: for standalone|netserver, ensure 'nut-server status' returns ? case "$1" in start) start-stop-daemon -S -q -p $upsmon_pid -x $upsmon \ -- $UPSMON_OPTIONS >/dev/null 2>&1 && return 0 || return 1 ;; stop) start-stop-daemon -K -o -q -p $upsmon_pid -n upsmon >/dev/null 2>&1 \ && return 0 || return 1 ;; esac ;; none|*) return 1 ;; esac } case "$1" in start) log_daemon_msg "Starting $DESC" "$NAME" check_var_directory start_stop_client start log_end_msg $? ;; stop) log_daemon_msg "Stopping $DESC" "$NAME" start_stop_client stop log_end_msg $? ;; reload) log_daemon_msg "Reloading $DESC" "$NAME" $upsmon -c reload >/dev/null 2>&1 log_end_msg $? ;; restart|force-reload) # FIXME: lack consistency, due to initscript split. # This only addresses partial reload. # Full reload requires to: # - stop nut-client # - restart (Ie stop+start) nut-server # - start nut-client log_daemon_msg "Restarting $DESC" "$NAME" start_stop_client stop || true # should then 'start_stop_server stop', Ie /etc/init.d/nut-server stop #sleep 5 check_var_directory # should first 'start_stop_server start', Ie /etc/init.d/nut-server start start_stop_client start log_end_msg $? ;; status) #log_daemon_msg "Checking status of $DESC" echo "Checking status of $DESC" check_status exit $? ;; poweroff) case "$MODE" in standalone|netserver) # Sanity check flag=`sed -ne 's#^ *POWERDOWNFLAG *\(.*\)$#\1#p' /etc/nut/upsmon.conf` if [ -z "$flag" ] ; then log_action_msg "##########################################################" log_action_msg "## POWERDOWNFLAG is not defined in /etc/nut/upsmon.conf ##" log_action_msg "## ##" log_action_msg "## Please read the Manual page upsmon.conf(5) ##" log_action_msg "##########################################################" exit 1 fi # Defer to nut-server to actually poweroff the UPS, if needed # (the need is tested here though!) if $upsmon -K >/dev/null 2>&1 ; then log_daemon_msg "UPS poweroff required..." log_end_msg 0 if [ -x /etc/init.d/nut-server ] ; then exec /etc/init.d/nut-server poweroff else log_action_msg "Failure: /etc/init.d/nut-server script missing" fi else log_action_msg "Power down flag is not set (UPS poweroff not needed)" fi ;; none|netclient|*) # nothing to do log_action_msg "'$MODE' configuration does not require UPS poweroff" ;; esac ;; *) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|reload|restart|force-reload|status|poweroff}" >&2 exit 1 ;; esac exit 0 debian/control0000644000000000000000000002121512260241137010570 0ustar Source: nut Section: admin Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Arnaud Quette Uploaders: Laurent Bigonville Build-Depends: debhelper (>= 8.1.3), cdbs (>= 0.4.122~), autotools-dev, dh-systemd (>= 1.4), libgd-dev | libgd2-xpm-dev | libgd2-noxpm-dev, libsnmp-dev | libsnmp9-dev, libusb-dev (>= 0.1.8), libneon27-gnutls-dev | libneon27-dev, libwrap0-dev (>= 7.6), python (>= 2.6.6-3~), libfreeipmi-dev (>= 0.8.5) [!hurd-i386], libipmimonitoring-dev (>= 1.1.5-2) [!hurd-i386], libnss3-dev Build-Depends-Indep: asciidoc (>= 8.6.3), docbook-xsl, dblatex (>= 0.2.5), libxml2-utils Standards-Version: 3.9.4 Homepage: http://www.networkupstools.org/ Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/nut.git;a=summary Vcs-Git: git://anonscm.debian.org/collab-maint/nut.git X-Python-Version: >= 2.5 XS-Testsuite: autopkgtest Package: nut Architecture: all Section: metapackages Depends: ${misc:Depends}, nut-server, nut-client Description: network UPS tools - metapackage Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and power distribution unit (PDU) hardware. Clients access the hardware through the server, and are notified whenever the power status changes. . This package is a metapackage that installs both nut-server and nut-client, in most cases it is sufficient for a basic UPS monitoring system. Package: nut-server Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6), ${udev}, nut-client (= ${binary:Version}) Suggests: nut-cgi, nut-snmp, nut-ipmi, nut-xml Conflicts: nut-hal-drivers Replaces: nut (<< 2.6.1-2~) Breaks: nut (<< 2.6.1-2~) Description: network UPS tools - core system Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and power distribution unit (PDU) hardware. Clients access the hardware through the server, and are notified whenever the power status changes. . This package provides NUT's core system, and the serial and USB UPS drivers. Package: nut-client Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lsb-base (>= 3.0-6) Provides: ups-monitor Conflicts: ups-monitor Recommends: bash-completion Suggests: nut-monitor Replaces: ups-monitor, nut (<< 2.6.1-2~), nut-server (<< 2.6.3-1~) Breaks: nut (<< 2.6.1-2~), nut-server (<< 2.6.3-1~) Description: network UPS tools - clients Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and power distribution unit (PDU) hardware. Clients access the hardware through the server, and are notified whenever the power status changes. . This package provides NUT's clients that allows the user to control and monitor the UPS. Package: nut-cgi Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, adduser Recommends: apache2 | httpd-cgi Suggests: nut Description: network UPS tools - web interface Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and power distribution unit (PDU) hardware. Clients access the hardware through the server, and are notified whenever the power status changes. . This package provides an HTTP interface for Network UPS Tools which makes it possible to monitor the core NUT system with a web browser. Package: nut-snmp Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, nut (>= 1.4.1-pre1) Description: network UPS tools - SNMP driver Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and power distribution unit (PDU) hardware. Clients access the hardware through the server, and are notified whenever the power status changes. . This package provides snmp-ups, the SNMP multi-MIB driver for UPS, which supports various MIBs including IETF, MGE, and APC. It adds an SNMP Manager interface to the core NUT system. Package: nut-ipmi Architecture: linux-any kfreebsd-any Depends: ${shlibs:Depends}, ${misc:Depends}, nut (>= 1.4.1-pre1) Description: network UPS tools - IPMI driver Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and power distribution unit (PDU) hardware. Clients access the hardware through the server, and are notified whenever the power status changes. . This package currently provides nut-ipmipsu, a driver which allows to monitor IPMI power supply units (PSU) found in servers of popular brands, such as Dell, HP, IBM. It adds an IPMI interface to the core NUT system. Package: nut-xml Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, nut (>= 2.2.2) Description: network UPS tools - XML/HTTP driver Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and power distribution unit (PDU) hardware. Clients access the hardware through the server, and are notified whenever the power status changes. . This package provides netxml-ups, which supports UPS models from Eaton or MGE that use an XML/HTTP-based Network Management Card or Proxy. Package: nut-doc Architecture: all Section: doc Depends: ${misc:Depends} Suggests: doc-base Description: network UPS tools - documentation Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and power distribution unit (PDU) hardware. Clients access the hardware through the server, and are notified whenever the power status changes. . This package contains FAQ, user, developer and packager documentation. Package: libupsclient3 Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Pre-Depends: ${misc:Pre-Depends} Multi-Arch: same Description: network UPS tools - client library Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and power distribution unit (PDU) hardware. Clients access the hardware through the server, and are notified whenever the power status changes. . This package provides the shared client library. Package: libupsclient-dev Section: libdevel Architecture: any Depends: libupsclient3 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} Conflicts: libupsclient1-dev Replaces: libupsclient1-dev Description: network UPS tools - development files Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and power distribution unit (PDU) hardware. Clients access the hardware through the server, and are notified whenever the power status changes. . This package provides the development files. Package: python-nut Section: python Architecture: all Depends: ${python:Depends}, ${misc:Depends} Description: network UPS tools - Python bindings for NUT server Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and power distribution unit (PDU) hardware. Clients access the hardware through the server, and are notified whenever the power status changes. . This package provides Python bindings to connect to NUT server. Package: nut-monitor Architecture: all Depends: ${python:Depends}, ${misc:Depends}, python-gobject, python-gtk2, python-glade2, python-nut Description: network UPS tools - GUI application to monitor UPS status Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and power distribution unit (PDU) hardware. Clients access the hardware through the server, and are notified whenever the power status changes. . This package provides nut-monitor, a GUI application to monitor UPS status. Package: libups-nut-perl Section: perl Architecture: all Depends: ${perl:Depends}, ${misc:Depends} Description: network UPS tools - Perl bindings for NUT server Network UPS Tools (NUT) is a client/server monitoring system that allows computers to share uninterruptible power supply (UPS) and power distribution unit (PDU) hardware. Clients access the hardware through the server, and are notified whenever the power status changes. . This package provides Perl bindings to connect to NUT server. debian/nut-doc.doc-base.nut-user-manual0000644000000000000000000000122412244455113015172 0ustar Document: nut-user-manual Title: Network UPS Tools User Manual Author: Russell Kroll, Arnaud Quette and Arjen de Korte Abstract: This document intend to describe how to install software support for your Power Devices (UPS, PDU, …), and how to use the NUT project. It is not intended to explain what are, nor distinguish the different technologies that exist. For such information, have a look at the General Power Devices Information. Section: System/Administration Format: PDF Files: /usr/share/doc/nut-doc/pdf/user-manual.pdf Format: HTML Index: /usr/share/doc/nut-doc/html/user-manual/index.html Files: /usr/share/doc/nut-doc/html/user-manual/*.html debian/nut-server.preinst0000644000000000000000000000057712244455113012720 0ustar #!/bin/sh -e if [ "$1" = upgrade ]; then # remove the obsolete udev file(s) [ -f /etc/udev/rules.d/025_nut-usbups.rules ] && rm -f /etc/udev/rules.d/025_nut-usbups.rules [ -f /etc/udev/rules.d/52_nut-usbups.rules ] && rm -f /etc/udev/rules.d/52_nut-usbups.rules [ -f /etc/udev/rules.d/52-nut-usbups.rules ] && rm -f /etc/udev/rules.d/52-nut-usbups.rules fi #DEBHELPER# exit 0 debian/nut.docs0000644000000000000000000000046612244455113010655 0ustar AUTHORS MAINTAINERS README UPGRADING docs/acknowledgements.txt docs/config-notes.txt docs/documentation.txt docs/download.txt docs/FAQ.txt docs/features.txt docs/history.txt docs/nut-names.txt docs/outlets.txt docs/packager-guide.txt docs/scheduling.txt docs/security.txt docs/support.txt docs/user-manual.txt debian/nut-server.prerm0000644000000000000000000000142512244455113012352 0ustar #!/bin/sh -e # the DEBHELPER token is purposely not used # because we don't want the daemon to be # stopped during an upgrade case "$1" in remove) # nut-usb specifics [ -f /etc/hotplug/usb/libhid.usermap ] && rm -f /etc/hotplug/usb/libhid.usermap [ -f /etc/hotplug/usb/libhidups ] && rm -f /etc/hotplug/usb/libhidups [ -L /usr/doc/nut ] && rm -f /usr/doc/nut # do stop the daemon on remove invoke-rc.d nut stop && sleep 1 [ -d /var/run/nut ] && rm -rf /var/run/nut/ ;; upgrade) [ -L /usr/doc/nut ] && rm -f /usr/doc/nut # do not stop the daemon on upgrade ;; failed-upgrade) # do nothing ;; deconfigure) # do nothing ;; *) echo "$0: incorrect arguments: $*" >&2 exit 1 ;; esac #DEBHELPER# exit 0 debian/tests/0000755000000000000000000000000012244455113010331 5ustar debian/tests/nut0000644000000000000000000000014212244455113011057 0ustar #!/bin/bash #------------ # Testing nut #------------ set -e python `dirname $0`/test-nut.py 2>&1 debian/tests/testlib.py0000644000000000000000000011534212244455113012357 0ustar # # testlib.py quality assurance test script # Copyright (C) 2008-2011 Canonical Ltd. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License. # # This library 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 # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program. If not, see # . # '''Common classes and functions for package tests.''' import string, random, crypt, subprocess, pwd, grp, signal, time, unittest, tempfile, shutil, os, os.path, re, glob import sys, socket, gzip from stat import * from encodings import string_escape import warnings warnings.filterwarnings('ignore', message=r'.*apt_pkg\.TagFile.*', category=DeprecationWarning) try: import apt_pkg apt_pkg.InitSystem(); except: # On non-Debian system, fall back to simple comparison without debianisms class apt_pkg(object): def VersionCompare(one, two): list_one = one.split('.') list_two = two.split('.') while len(list_one)>0 and len(list_two)>0: if list_one[0] > list_two[0]: return 1 if list_one[0] < list_two[0]: return -1 list_one.pop(0) list_two.pop(0) return 0 bogus_nxdomain = "208.69.32.132" # http://www.chiark.greenend.org.uk/ucgi/~cjwatson/blosxom/2009-07-02-python-sigpipe.html # This is needed so that the subprocesses that produce endless output # actually quit when the reader goes away. import signal def subprocess_setup(): # Python installs a SIGPIPE handler by default. This is usually not what # non-Python subprocesses expect. signal.signal(signal.SIGPIPE, signal.SIG_DFL) class TimedOutException(Exception): def __init__(self, value = "Timed Out"): self.value = value def __str__(self): return repr(self.value) def _restore_backup(path): pathbackup = path + '.autotest' if os.path.exists(pathbackup): shutil.move(pathbackup, path) def _save_backup(path): pathbackup = path + '.autotest' if os.path.exists(path) and not os.path.exists(pathbackup): shutil.copy2(path, pathbackup) # copy2 does not copy ownership, so do it here. # Reference: http://docs.python.org/library/shutil.html a = os.stat(path) os.chown(pathbackup, a[4], a[5]) def config_copydir(path): if os.path.exists(path) and not os.path.isdir(path): raise OSError, "'%s' is not a directory" % (path) _restore_backup(path) pathbackup = path + '.autotest' if os.path.exists(path): shutil.copytree(path, pathbackup, symlinks=True) def config_replace(path,contents,append=False): '''Replace (or append) to a config file''' _restore_backup(path) if os.path.exists(path): _save_backup(path) if append: contents = file(path).read() + contents open(path, 'w').write(contents) def config_comment(path, field): _save_backup(path) contents = "" for line in file(path): if re.search("^\s*%s\s*=" % (field), line): line = "#" + line contents += line open(path+'.new', 'w').write(contents) os.rename(path+'.new', path) def config_set(path, field, value, spaces=True): _save_backup(path) contents = "" if spaces==True: setting = '%s = %s\n' % (field, value) else: setting = '%s=%s\n' % (field, value) found = False for line in file(path): if re.search("^\s*%s\s*=" % (field), line): found = True line = setting contents += line if not found: contents += setting open(path+'.new', 'w').write(contents) os.rename(path+'.new', path) def config_patch(path, patch, depth=1): '''Patch a config file''' _restore_backup(path) _save_backup(path) handle, name = mkstemp_fill(patch) rc = subprocess.call(['/usr/bin/patch', '-p%s' %(depth), path], stdin=handle, stdout=subprocess.PIPE) os.unlink(name) if rc != 0: raise Exception("Patch failed") def config_restore(path): '''Rename a replaced config file back to its initial state''' _restore_backup(path) def timeout(secs, f, *args): def handler(signum, frame): raise TimedOutException() old = signal.signal(signal.SIGALRM, handler) result = None signal.alarm(secs) try: result = f(*args) finally: signal.alarm(0) signal.signal(signal.SIGALRM, old) return result def require_nonroot(): if os.geteuid() == 0: print >>sys.stderr, "This series of tests should be run as a regular user with sudo access, not as root." sys.exit(1) def require_root(): if os.geteuid() != 0: print >>sys.stderr, "This series of tests should be run with root privileges (e.g. via sudo)." sys.exit(1) def require_sudo(): if os.geteuid() != 0 or os.environ.get('SUDO_USER', None) == None: print >>sys.stderr, "This series of tests must be run under sudo." sys.exit(1) if os.environ['SUDO_USER'] == 'root': print >>sys.stderr, 'Please run this test using sudo from a regular user. (You ran sudo from root.)' sys.exit(1) def random_string(length,lower=False): '''Return a random string, consisting of ASCII letters, with given length.''' s = '' selection = string.letters if lower: selection = string.lowercase maxind = len(selection)-1 for l in range(length): s += selection[random.randint(0, maxind)] return s def mkstemp_fill(contents,suffix='',prefix='testlib-',dir=None): '''As tempfile.mkstemp does, return a (file, name) pair, but with prefilled contents.''' handle, name = tempfile.mkstemp(suffix=suffix,prefix=prefix,dir=dir) os.close(handle) handle = file(name,"w+") handle.write(contents) handle.flush() handle.seek(0) return handle, name def create_fill(path, contents, mode=0644): '''Safely create a page''' # make the temp file in the same dir as the destination file so we # don't get invalid cross-device link errors when we rename handle, name = mkstemp_fill(contents, dir=os.path.dirname(path)) handle.close() os.rename(name, path) os.chmod(path, mode) def login_exists(login): '''Checks whether the given login exists on the system.''' try: pwd.getpwnam(login) return True except KeyError: return False def group_exists(group): '''Checks whether the given login exists on the system.''' try: grp.getgrnam(group) return True except KeyError: return False def recursive_rm(dirPath, contents_only=False): '''recursively remove directory''' names = os.listdir(dirPath) for name in names: path = os.path.join(dirPath, name) if os.path.islink(path) or not os.path.isdir(path): os.unlink(path) else: recursive_rm(path) if contents_only == False: os.rmdir(dirPath) def check_pidfile(exe, pidfile): '''Checks if pid in pidfile is running''' if not os.path.exists(pidfile): return False # get the pid try: fd = open(pidfile, 'r') pid = fd.readline().rstrip('\n') fd.close() except: return False return check_pid(exe, pid) def check_pid(exe, pid): '''Checks if pid is running''' cmdline = "/proc/%s/cmdline" % (str(pid)) if not os.path.exists(cmdline): return False # get the command line try: fd = open(cmdline, 'r') tmp = fd.readline().split('\0') fd.close() except: return False # this allows us to match absolute paths or just the executable name if re.match('^' + exe + '$', tmp[0]) or \ re.match('.*/' + exe + '$', tmp[0]) or \ re.match('^' + exe + ': ', tmp[0]) or \ re.match('^\(' + exe + '\)', tmp[0]): return True return False def check_port(port, proto, ver=4): '''Check if something is listening on the specified port. WARNING: for some reason this does not work with a bind mounted /proc ''' assert (port >= 1) assert (port <= 65535) assert (proto.lower() == "tcp" or proto.lower() == "udp") assert (ver == 4 or ver == 6) fn = "/proc/net/%s" % (proto) if ver == 6: fn += str(ver) rc, report = cmd(['cat', fn]) assert (rc == 0) hport = "%0.4x" % port if re.search(': [0-9a-f]{8}:%s [0-9a-f]' % str(hport).lower(), report.lower()): return True return False def get_arch(): '''Get the current architecture''' rc, report = cmd(['uname', '-m']) assert (rc == 0) return report.strip() def get_memory(): '''Gets total ram and swap''' meminfo = "/proc/meminfo" memtotal = 0 swaptotal = 0 if not os.path.exists(meminfo): return (False, False) try: fd = open(meminfo, 'r') for line in fd.readlines(): splitline = line.split() if splitline[0] == 'MemTotal:': memtotal = int(splitline[1]) elif splitline[0] == 'SwapTotal:': swaptotal = int(splitline[1]) fd.close() except: return (False, False) return (memtotal,swaptotal) def is_running_in_vm(): '''Check if running under a VM''' # add other virtualization environments here for search in ['QEMU Virtual CPU']: rc, report = cmd_pipe(['dmesg'], ['grep', search]) if rc == 0: return True return False def ubuntu_release(): '''Get the Ubuntu release''' f = "/etc/lsb-release" try: size = os.stat(f)[ST_SIZE] except: return "UNKNOWN" if size > 1024*1024: raise IOError, 'Could not open "%s" (too big)' % f try: fh = open("/etc/lsb-release", 'r') except: raise lines = fh.readlines() fh.close() pat = re.compile(r'DISTRIB_CODENAME') for line in lines: if pat.search(line): return line.split('=')[1].rstrip('\n').rstrip('\r') return "UNKNOWN" def cmd(command, input = None, stderr = subprocess.STDOUT, stdout = subprocess.PIPE, stdin = None, timeout = None): '''Try to execute given command (array) and return its stdout, or return a textual error if it failed.''' try: sp = subprocess.Popen(command, stdin=stdin, stdout=stdout, stderr=stderr, close_fds=True, preexec_fn=subprocess_setup) except OSError, e: return [127, str(e)] out, outerr = sp.communicate(input) # Handle redirection of stdout if out == None: out = '' # Handle redirection of stderr if outerr == None: outerr = '' return [sp.returncode,out+outerr] def cmd_pipe(command1, command2, input = None, stderr = subprocess.STDOUT, stdin = None): '''Try to pipe command1 into command2.''' try: sp1 = subprocess.Popen(command1, stdin=stdin, stdout=subprocess.PIPE, stderr=stderr, close_fds=True) sp2 = subprocess.Popen(command2, stdin=sp1.stdout, stdout=subprocess.PIPE, stderr=stderr, close_fds=True) except OSError, e: return [127, str(e)] out = sp2.communicate(input)[0] return [sp2.returncode,out] def cwd_has_enough_space(cdir, total_bytes): '''Determine if the partition of the current working directory has 'bytes' free.''' rc, df_output = cmd(['df']) result = 'Got exit code %d, expected %d\n' % (rc, 0) if rc != 0: return False kb = total_bytes / 1024 mounts = dict() for line in df_output.splitlines(): if '/' not in line: continue tmp = line.split() mounts[tmp[5]] = int(tmp[3]) cdir = os.getcwd() while cdir != '/': if not mounts.has_key(cdir): cdir = os.path.dirname(cdir) continue if kb < mounts[cdir]: return True else: return False if kb < mounts['/']: return True return False def get_md5(filename): '''Gets the md5sum of the file specified''' (rc, report) = cmd(["/usr/bin/md5sum", "-b", filename]) expected = 0 assert (expected == rc) return report.split(' ')[0] def dpkg_compare_installed_version(pkg, check, version): '''Gets the version for the installed package, and compares it to the specified version. ''' (rc, report) = cmd(["/usr/bin/dpkg", "-s", pkg]) assert (rc == 0) assert ("Status: install ok installed" in report) installed_version = "" for line in report.splitlines(): if line.startswith("Version: "): installed_version = line.split()[1] assert (installed_version != "") (rc, report) = cmd(["/usr/bin/dpkg", "--compare-versions", installed_version, check, version]) assert (rc == 0 or rc == 1) if rc == 0: return True return False def prepare_source(source, builder, cached_src, build_src, patch_system): '''Download and unpack source package, installing necessary build depends, adjusting the permissions for the 'builder' user, and returning the directory of the unpacked source. Patch system can be one of: - cdbs - dpatch - quilt - quiltv3 - None (not the string) This is normally used like this: def setUp(self): ... self.topdir = os.getcwd() self.cached_src = os.path.join(os.getcwd(), "source") self.tmpdir = tempfile.mkdtemp(prefix='testlib', dir='/tmp') self.builder = testlib.TestUser() testlib.cmd(['chgrp', self.builder.login, self.tmpdir]) os.chmod(self.tmpdir, 0775) def tearDown(self): ... self.builder = None self.topdir = os.getcwd() if os.path.exists(self.tmpdir): testlib.recursive_rm(self.tmpdir) def test_suite_build(self): ... build_dir = testlib.prepare_source('foo', \ self.builder, \ self.cached_src, \ os.path.join(self.tmpdir, \ os.path.basename(self.cached_src)), "quilt") os.chdir(build_dir) # Example for typical build, adjust as necessary print "" print " make clean" rc, report = testlib.cmd(['sudo', '-u', self.builder.login, 'make', 'clean']) print " configure" rc, report = testlib.cmd(['sudo', '-u', self.builder.login, './configure', '--prefix=%s' % self.tmpdir, '--enable-debug']) print " make (will take a while)" rc, report = testlib.cmd(['sudo', '-u', self.builder.login, 'make']) print " make check (will take a while)", rc, report = testlib.cmd(['sudo', '-u', self.builder.login, 'make', 'check']) expected = 0 result = 'Got exit code %d, expected %d\n' % (rc, expected) self.assertEquals(expected, rc, result + report) def test_suite_cleanup(self): ... if os.path.exists(self.cached_src): testlib.recursive_rm(self.cached_src) It is up to the caller to clean up cached_src and build_src (as in the above example, often the build_src is in a tmpdir that is cleaned in tearDown() and the cached_src is cleaned in a one time clean-up operation (eg 'test_suite_cleanup()) which must be run after the build suite test (obviously). ''' # Make sure we have a clean slate assert (os.path.exists(os.path.dirname(build_src))) assert (not os.path.exists(build_src)) cdir = os.getcwd() if os.path.exists(cached_src): shutil.copytree(cached_src, build_src) os.chdir(build_src) else: # Only install the build dependencies on the initial setup rc, report = cmd(['apt-get','-y','--force-yes','build-dep',source]) assert (rc == 0) os.makedirs(build_src) os.chdir(build_src) # These are always needed pkgs = ['build-essential', 'dpkg-dev', 'fakeroot'] rc, report = cmd(['apt-get','-y','--force-yes','install'] + pkgs) assert (rc == 0) rc, report = cmd(['apt-get','source',source]) assert (rc == 0) shutil.copytree(build_src, cached_src) unpacked_dir = os.path.join(build_src, glob.glob('%s-*' % source)[0]) # Now apply the patches. Do it here so that we don't mess up our cached # sources. os.chdir(unpacked_dir) assert (patch_system in ['cdbs', 'dpatch', 'quilt', 'quiltv3', None]) if patch_system != None and patch_system != "quiltv3": if patch_system == "quilt": os.environ.setdefault('QUILT_PATCHES','debian/patches') rc, report = cmd(['quilt', 'push', '-a']) assert (rc == 0) elif patch_system == "cdbs": rc, report = cmd(['./debian/rules', 'apply-patches']) assert (rc == 0) elif patch_system == "dpatch": rc, report = cmd(['dpatch', 'apply-all']) assert (rc == 0) cmd(['chown', '-R', '%s:%s' % (builder.uid, builder.gid), build_src]) os.chdir(cdir) return unpacked_dir def _aa_status(): '''Get aa-status output''' exe = "/usr/sbin/aa-status" assert (os.path.exists(exe)) if os.geteuid() == 0: return cmd([exe]) return cmd(['sudo', exe]) def is_apparmor_loaded(path): '''Check if profile is loaded''' rc, report = _aa_status() if rc != 0: return False for line in report.splitlines(): if line.endswith(path): return True return False def is_apparmor_confined(path): '''Check if application is confined''' rc, report = _aa_status() if rc != 0: return False for line in report.splitlines(): if re.search('%s \(' % path, line): return True return False def check_apparmor(path, first_ubuntu_release, is_running=True): '''Check if path is loaded and confined for everything higher than the first Ubuntu release specified. Usage: rc, report = testlib.check_apparmor('/usr/sbin/foo', 8.04, is_running=True) if rc < 0: return self._skipped(report) expected = 0 result = 'Got exit code %d, expected %d\n' % (rc, expected) self.assertEquals(expected, rc, result + report) ''' global manager rc = -1 if manager.lsb_release["Release"] < first_ubuntu_release: return (rc, "Skipped apparmor check") if not os.path.exists('/sbin/apparmor_parser'): return (rc, "Skipped (couldn't find apparmor_parser)") rc = 0 msg = "" if not is_apparmor_loaded(path): rc = 1 msg = "Profile not loaded for '%s'" % path # this check only makes sense it the 'path' is currently executing if is_running and rc == 0 and not is_apparmor_confined(path): rc = 1 msg = "'%s' is not running in enforce mode" % path return (rc, msg) def get_gcc_version(gcc, full=True): gcc_version = 'none' if not gcc.startswith('/'): gcc = '/usr/bin/%s' % (gcc) if os.path.exists(gcc): gcc_version = 'unknown' lines = cmd([gcc,'-v'])[1].strip().splitlines() version_lines = [x for x in lines if x.startswith('gcc version')] if len(version_lines) == 1: gcc_version = " ".join(version_lines[0].split()[2:]) if not full: return gcc_version.split()[0] return gcc_version def is_kdeinit_running(): '''Test if kdeinit is running''' # applications that use kdeinit will spawn it if it isn't running in the # test. This is a problem because it does not exit. This is a helper to # check for it. rc, report = cmd(['ps', 'x']) if 'kdeinit4 Running' not in report: print >>sys.stderr, ("kdeinit not running (you may start/stop any KDE application then run this script again)") return False return True def get_pkgconfig_flags(libs=[]): '''Find pkg-config flags for libraries''' assert (len(libs) > 0) rc, pkg_config = cmd(['pkg-config', '--cflags', '--libs'] + libs) expected = 0 if rc != expected: print >>sys.stderr, 'Got exit code %d, expected %d\n' % (rc, expected) assert(rc == expected) return pkg_config.split() class TestDaemon: '''Helper class to manage daemons consistently''' def __init__(self, init): '''Setup daemon attributes''' self.initscript = init def start(self): '''Start daemon''' rc, report = cmd([self.initscript, 'start']) expected = 0 result = 'Got exit code %d, expected %d\n' % (rc, expected) time.sleep(2) if expected != rc: return (False, result + report) if "fail" in report: return (False, "Found 'fail' in report\n" + report) return (True, "") def stop(self): '''Stop daemon''' rc, report = cmd([self.initscript, 'stop']) expected = 0 result = 'Got exit code %d, expected %d\n' % (rc, expected) if expected != rc: return (False, result + report) if "fail" in report: return (False, "Found 'fail' in report\n" + report) return (True, "") def reload(self): '''Reload daemon''' rc, report = cmd([self.initscript, 'force-reload']) expected = 0 result = 'Got exit code %d, expected %d\n' % (rc, expected) if expected != rc: return (False, result + report) if "fail" in report: return (False, "Found 'fail' in report\n" + report) return (True, "") def restart(self): '''Restart daemon''' (res, str) = self.stop() if not res: return (res, str) (res, str) = self.start() if not res: return (res, str) return (True, "") def status(self): '''Check daemon status''' rc, report = cmd([self.initscript, 'status']) expected = 0 result = 'Got exit code %d, expected %d\n' % (rc, expected) if expected != rc: return (False, result + report) if "fail" in report: return (False, "Found 'fail' in report\n" + report) return (True, "") class TestlibManager(object): '''Singleton class used to set up per-test-run information''' def __init__(self): # Set glibc aborts to dump to stderr instead of the tty so test output # is more sane. os.environ.setdefault('LIBC_FATAL_STDERR_','1') # check verbosity self.verbosity = False if (len(sys.argv) > 1 and '-v' in sys.argv[1:]): self.verbosity = True # Load LSB release file self.lsb_release = dict() if not os.path.exists('/usr/bin/lsb_release') and not os.path.exists('/bin/lsb_release'): raise OSError, "Please install 'lsb-release'" for line in subprocess.Popen(['lsb_release','-a'],stdout=subprocess.PIPE,stderr=subprocess.PIPE).communicate()[0].splitlines(): field, value = line.split(':',1) value=value.strip() field=field.strip() # Convert numerics try: value = float(value) except: pass self.lsb_release.setdefault(field,value) # FIXME: hack OEM releases into known-Ubuntu versions if self.lsb_release['Distributor ID'] == "HP MIE (Mobile Internet Experience)": if self.lsb_release['Release'] == 1.0: self.lsb_release['Distributor ID'] = "Ubuntu" self.lsb_release['Release'] = 8.04 else: raise OSError, "Unknown version of HP MIE" # FIXME: hack to assume a most-recent release if we're not # running under Ubuntu. if self.lsb_release['Distributor ID'] not in ["Ubuntu","Linaro"]: self.lsb_release['Release'] = 10000 # Adjust Linaro release to pretend to be Ubuntu if self.lsb_release['Distributor ID'] in ["Linaro"]: self.lsb_release['Distributor ID'] = "Ubuntu" self.lsb_release['Release'] -= 0.01 # Load arch if not os.path.exists('/usr/bin/dpkg'): machine = cmd(['uname','-m'])[1].strip() if machine.endswith('86'): self.dpkg_arch = 'i386' elif machine.endswith('_64'): self.dpkg_arch = 'amd64' elif machine.startswith('arm'): self.dpkg_arch = 'armel' else: raise ValueError, "Unknown machine type '%s'" % (machine) else: self.dpkg_arch = cmd(['dpkg','--print-architecture'])[1].strip() # Find kernel version self.kernel_is_ubuntu = False self.kernel_version_signature = None self.kernel_version = cmd(["uname","-r"])[1].strip() versig = '/proc/version_signature' if os.path.exists(versig): self.kernel_is_ubuntu = True self.kernel_version_signature = file(versig).read().strip() self.kernel_version_ubuntu = self.kernel_version elif os.path.exists('/usr/bin/dpkg'): # this can easily be inaccurate but is only an issue for Dapper rc, out = cmd(['dpkg','-l','linux-image-%s' % (self.kernel_version)]) if rc == 0: self.kernel_version_signature = out.strip().split('\n').pop().split()[2] self.kernel_version_ubuntu = self.kernel_version_signature if self.kernel_version_signature == None: # Attempt to fall back to something for non-Debian-based self.kernel_version_signature = self.kernel_version self.kernel_version_ubuntu = self.kernel_version # Build ubuntu version without hardware suffix try: self.kernel_version_ubuntu = "-".join([x for x in self.kernel_version_signature.split(' ')[1].split('-') if re.search('^[0-9]', x)]) except: pass # Find gcc version self.gcc_version = get_gcc_version('gcc') # Find libc self.path_libc = [x.split()[2] for x in cmd(['ldd','/bin/ls'])[1].splitlines() if x.startswith('\tlibc.so.')][0] # Report self if self.verbosity: kernel = self.kernel_version_ubuntu if kernel != self.kernel_version_signature: kernel += " (%s)" % (self.kernel_version_signature) print >>sys.stdout, "Running test: '%s' distro: '%s %.2f' kernel: '%s' arch: '%s' uid: %d/%d SUDO_USER: '%s')" % ( \ sys.argv[0], self.lsb_release['Distributor ID'], self.lsb_release['Release'], kernel, self.dpkg_arch, os.geteuid(), os.getuid(), os.environ.get('SUDO_USER', '')) sys.stdout.flush() # Additional heuristics #if os.environ.get('SUDO_USER', os.environ.get('USER', '')) in ['mdeslaur']: # sys.stdout.write("Replying to Marc Deslauriers in http://launchpad.net/bugs/%d: " % random.randint(600000, 980000)) # sys.stdout.flush() # time.sleep(0.5) # sys.stdout.write("destroyed\n") # time.sleep(0.5) def hello(self, msg): print >>sys.stderr, "Hello from %s" % (msg) # The central instance manager = TestlibManager() class TestlibCase(unittest.TestCase): def __init__(self, *args): '''This is called for each TestCase test instance, which isn't much better than SetUp.''' unittest.TestCase.__init__(self, *args) # Attach to and duplicate dicts from manager singleton self.manager = manager #self.manager.hello(repr(self) + repr(*args)) self.my_verbosity = self.manager.verbosity self.lsb_release = self.manager.lsb_release self.dpkg_arch = self.manager.dpkg_arch self.kernel_version = self.manager.kernel_version self.kernel_version_signature = self.manager.kernel_version_signature self.kernel_version_ubuntu = self.manager.kernel_version_ubuntu self.kernel_is_ubuntu = self.manager.kernel_is_ubuntu self.gcc_version = self.manager.gcc_version self.path_libc = self.manager.path_libc def version_compare(self, one, two): return apt_pkg.VersionCompare(one,two) def assertFileType(self, filename, filetype): '''Checks the file type of the file specified''' (rc, report, out) = self._testlib_shell_cmd(["/usr/bin/file", "-b", filename]) out = out.strip() expected = 0 # Absolutely no idea why this happens on Hardy if self.lsb_release['Release'] == 8.04 and rc == 255 and len(out) > 0: rc = 0 result = 'Got exit code %d, expected %d:\n%s\n' % (rc, expected, report) self.assertEquals(expected, rc, result) filetype = '^%s$' % (filetype) result = 'File type reported by file: [%s], expected regex: [%s]\n' % (out, filetype) self.assertNotEquals(None, re.search(filetype, out), result) def yank_commonname_from_cert(self, certfile): '''Extract the commonName from a given PEM''' rc, out = cmd(['openssl','asn1parse','-in',certfile]) if rc == 0: ready = False for line in out.splitlines(): if ready: return line.split(':')[-1] if ':commonName' in line: ready = True return socket.getfqdn() def announce(self, text): if self.my_verbosity: print >>sys.stdout, "(%s) " % (text), sys.stdout.flush() def make_clean(self): rc, output = self.shell_cmd(['make','clean']) self.assertEquals(rc, 0, output) def get_makefile_compiler(self): # Find potential compiler name compiler = 'gcc' if os.path.exists('Makefile'): for line in open('Makefile'): if line.startswith('CC') and '=' in line: items = [x.strip() for x in line.split('=')] if items[0] == 'CC': compiler = items[1] break return compiler def make_target(self, target, expected=0): '''Compile a target and report output''' compiler = self.get_makefile_compiler() rc, output = self.shell_cmd(['make',target]) self.assertEquals(rc, expected, 'rc(%d)!=%d:\n' % (rc, expected) + output) self.assertTrue('%s ' % (compiler) in output, 'Expected "%s":' % (compiler) + output) return output # call as return testlib.skipped() def _skipped(self, reason=""): '''Provide a visible way to indicate that a test was skipped''' if reason != "": reason = ': %s' % (reason) self.announce("skipped%s" % (reason)) return False def _testlib_shell_cmd(self,args,stdin=None, stdout=subprocess.PIPE, stderr=subprocess.STDOUT): argstr = "'" + "', '".join(args).strip() + "'" rc, out = cmd(args,stdin=stdin,stdout=stdout,stderr=stderr) report = 'Command: ' + argstr + '\nOutput:\n' + out return rc, report, out def shell_cmd(self, args, stdin=None): return cmd(args,stdin=stdin) def assertShellExitEquals(self, expected, args, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, msg=""): '''Test a shell command matches a specific exit code''' rc, report, out = self._testlib_shell_cmd(args, stdin=stdin, stdout=stdout, stderr=stderr) result = 'Got exit code %d, expected %d\n' % (rc, expected) self.assertEquals(expected, rc, msg + result + report) def assertShellExitNotEquals(self, unwanted, args, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, msg=""): '''Test a shell command doesn't match a specific exit code''' rc, report, out = self._testlib_shell_cmd(args, stdin=stdin, stdout=stdout, stderr=stderr) result = 'Got (unwanted) exit code %d\n' % rc self.assertNotEquals(unwanted, rc, msg + result + report) def assertShellOutputContains(self, text, args, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, msg="", invert=False): '''Test a shell command contains a specific output''' rc, report, out = self._testlib_shell_cmd(args, stdin=stdin, stdout=stdout, stderr=stderr) result = 'Got exit code %d. Looking for text "%s"\n' % (rc, text) if not invert: self.assertTrue(text in out, msg + result + report) else: self.assertFalse(text in out, msg + result + report) def assertShellOutputEquals(self, text, args, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, msg="", invert=False, expected=None): '''Test a shell command matches a specific output''' rc, report, out = self._testlib_shell_cmd(args, stdin=stdin, stdout=stdout, stderr=stderr) result = 'Got exit code %d. Looking for exact text "%s" (%s)\n' % (rc, text, " ".join(args)) if not invert: self.assertEquals(text, out, msg + result + report) else: self.assertNotEquals(text, out, msg + result + report) if expected != None: result = 'Got exit code %d. Expected %d (%s)\n' % (rc, expected, " ".join(args)) self.assertEquals(rc, expected, msg + result + report) def _word_find(self, report, content, invert=False): '''Check for a specific string''' if invert: warning = 'Found "%s"\n' % content self.assertTrue(content not in report, warning + report) else: warning = 'Could not find "%s"\n' % content self.assertTrue(content in report, warning + report) def _test_sysctl_value(self, path, expected, msg=None, exists=True): sysctl = '/proc/sys/%s' % (path) self.assertEquals(exists, os.path.exists(sysctl), sysctl) value = None if exists: value = int(file(sysctl).read()) report = "%s is not %d: %d" % (sysctl, expected, value) if msg: report += " (%s)" % (msg) self.assertEquals(value, expected, report) return value def set_sysctl_value(self, path, desired): sysctl = '/proc/sys/%s' % (path) self.assertTrue(os.path.exists(sysctl),"%s does not exist" % (sysctl)) file(sysctl,'w').write(str(desired)) self._test_sysctl_value(path, desired) def kernel_at_least(self, introduced): return self.version_compare(self.kernel_version_ubuntu, introduced) >= 0 def kernel_claims_cve_fixed(self, cve): changelog = "/usr/share/doc/linux-image-%s/changelog.Debian.gz" % (self.kernel_version) if os.path.exists(changelog): for line in gzip.open(changelog): if cve in line and not "revert" in line and not "Revert" in line: return True return False class TestGroup: '''Create a temporary test group and remove it again in the dtor.''' def __init__(self, group=None, lower=False): '''Create a new group''' self.group = None if group: if group_exists(group): raise ValueError, 'group name already exists' else: while(True): group = random_string(7,lower=lower) if not group_exists(group): break assert subprocess.call(['groupadd',group]) == 0 self.group = group g = grp.getgrnam(self.group) self.gid = g[2] def __del__(self): '''Remove the created group.''' if self.group: rc, report = cmd(['groupdel', self.group]) assert rc == 0 class TestUser: '''Create a temporary test user and remove it again in the dtor.''' def __init__(self, login=None, home=True, group=None, uidmin=None, lower=False, shell=None): '''Create a new user account with a random password. By default, the login name is random, too, but can be explicitly specified with 'login'. By default, a home directory is created, this can be suppressed with 'home=False'.''' self.login = None if os.geteuid() != 0: raise ValueError, "You must be root to run this test" if login: if login_exists(login): raise ValueError, 'login name already exists' else: while(True): login = 't' + random_string(7,lower=lower) if not login_exists(login): break self.salt = random_string(2) self.password = random_string(8,lower=lower) self.crypted = crypt.crypt(self.password, self.salt) creation = ['useradd', '-p', self.crypted] if home: creation += ['-m'] if group: creation += ['-G',group] if uidmin: creation += ['-K','UID_MIN=%d'%uidmin] if shell: creation += ['-s',shell] creation += [login] assert subprocess.call(creation) == 0 # Set GECOS assert subprocess.call(['usermod','-c','Buddy %s' % (login),login]) == 0 self.login = login p = pwd.getpwnam(self.login) self.uid = p[2] self.gid = p[3] self.gecos = p[4] self.home = p[5] self.shell = p[6] def __del__(self): '''Remove the created user account.''' if self.login: # sanity check the login name so we don't accidentally wipe too much if len(self.login)>3 and not '/' in self.login: subprocess.call(['rm','-rf', '/home/'+self.login, '/var/mail/'+self.login]) rc, report = cmd(['userdel', '-f', self.login]) assert rc == 0 def add_to_group(self, group): '''Add user to the specified group name''' rc, report = cmd(['usermod', '-G', group, self.login]) if rc != 0: print report assert rc == 0 # Timeout handler using alarm() from John P. Speno's Pythonic Avocado class TimeoutFunctionException(Exception): """Exception to raise on a timeout""" pass class TimeoutFunction: def __init__(self, function, timeout): self.timeout = timeout self.function = function def handle_timeout(self, signum, frame): raise TimeoutFunctionException() def __call__(self, *args, **kwargs): old = signal.signal(signal.SIGALRM, self.handle_timeout) signal.alarm(self.timeout) try: result = self.function(*args, **kwargs) finally: signal.signal(signal.SIGALRM, old) signal.alarm(0) return result def main(): print "hi" unittest.main() debian/tests/test-nut.py0000644000000000000000000003562512244455113012501 0ustar #!/usr/bin/python # # test-nut.py quality assurance test script # Copyright (C) 2008-2011 Arnaud Quette # Copyright (C) 2012 Jamie Strandboge # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3, # as published by the Free Software Foundation. # # 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 . # ''' *** IMPORTANT *** DO NOT RUN ON A PRODUCTION SERVER. *** IMPORTANT *** How to run (up to natty): $ sudo apt-get -y install python-unit nut $ sudo ./test-nut.py -v How to run (oneiric+): $ sudo apt-get -y install python-unit nut-server nut-client $ sudo ./test-nut.py -v NOTE: - NUT architecture (helps understanding): http://www.networkupstools.org/docs/developer-guide.chunked/ar01s02.html#_the_layering - These tests only validate the NUT software framework itself (communication between the drivers, server and client layers ; events propagation and detection). The critical part of NUT, Ie the driver layer which communicate with actual devices, can only be tested with real hardware! - These tests use the NUT simulation driver (dummy-ups) to emulate real hardware behavior, and generate events (power failure, low battery, ...). TODO: - improve test duration, by reworking NutTestCommon._setUp() and the way daemons are started (ie, always) - more events testing (upsmon / upssched) - test syslog and wall output - test UPS redundancy - test Powerchain (once available!) - test AppArmor (once available!) - add hardware testing as Private tests? - load a .dev file, and test a full output QA INFORMATION: - NUT provides "make check" and "make distcheck" in its source distribution - NUT provides Quality Assurance information, to track all efforts: http://www.networkupstools.org/nut-qa.html ''' # QRT-Packages: python-unit netcat-openbsd # QRT-Alternates: nut-server nut # QRT-Alternates: nut-client nut # nut-dev is needed for the dummy driver on hardy # QRT-Alternates: nut-dev # QRT-Privilege: root # QRT-Depends: import unittest, subprocess, sys, os, time import tempfile import testlib use_private = True try: from private.qrt.nut import PrivateNutTest except ImportError: class PrivateNutTest(object): '''Empty class''' print >>sys.stdout, "Skipping private tests" class NutTestCommon(testlib.TestlibCase): '''Common functions''' # FIXME: initscript will be splitted into nut-server and nut-client # (Debian bug #634858) initscript = "/etc/init.d/nut-server" hosts_file = "/etc/hosts" powerdownflag = "/etc/killpower" shutdowncmd = "/tmp/shutdowncmd" notifyscript = "/tmp/nutifyme" notifylog = "/tmp/notify.log" def _setUp(self): '''Set up prior to each test_* function''' '''We generate a NUT config using the dummmy-ups driver and standard settings for local monitoring ''' self.tmpdir = "" self.rundir = "/var/run/nut" testlib.cmd(['/bin/rm -f' + self.powerdownflag]) testlib.config_replace('/etc/nut/ups.conf', ''' [dummy-dev1] driver = dummy-ups port = dummy.dev desc = "simulation device" ''') if self.lsb_release['Release'] <= 8.04: testlib.config_replace('/etc/nut/upsd.conf', ''' ACL dummy-net 127.0.0.1/8 ACL dummy-net2 ::1/64 ACL all 0.0.0.0/0 ACCEPT dummy-net dummy-net2 REJECT all ''') else: testlib.config_replace('/etc/nut/upsd.conf', '''# just to touch the file''') extra_cfgs = '' if self.lsb_release['Release'] <= 8.04: extra_cfgs = ''' allowfrom = dummy-net dummy-net2 ''' testlib.config_replace('/etc/nut/upsd.users', ''' [admin] password = dummypass actions = SET instcmds = ALL %s [monuser] password = dummypass upsmon master %s ''' %(extra_cfgs, extra_cfgs)) testlib.config_replace('/etc/nut/upsmon.conf', ''' MONITOR dummy-dev1@localhost 1 monuser dummy-pass master MINSUPPLIES 1 SHUTDOWNCMD "/usr/bin/touch ''' + self.shutdowncmd + '"\n' '''POWERDOWNFLAG ''' + self.powerdownflag + '\n' ''' NOTIFYCMD ''' + self.notifyscript + '\n' ''' NOTIFYFLAG ONLINE SYSLOG+EXEC NOTIFYFLAG ONBATT SYSLOG+EXEC NOTIFYFLAG LOWBATT SYSLOG+EXEC NOTIFYFLAG FSD SYSLOG+EXEC # NOTIFYFLAG COMMOK SYSLOG+EXEC # NOTIFYFLAG COMMBAD SYSLOG+EXEC NOTIFYFLAG SHUTDOWN SYSLOG+EXEC # NOTIFYFLAG REPLBATT SYSLOG+EXEC # NOTIFYFLAG NOCOMM SYSLOG+EXEC # NOTIFYFLAG NOPARENT SYSLOG+EXEC # Shorten test duration by: # Speeding up polling frequency POLLFREQ 2 # And final wait delay FINALDELAY 0 ''' ) testlib.create_fill(self.notifyscript, ''' #! /bin/bash echo "$*" > ''' + self.notifylog + '\n', mode=0755) # dummy-ups absolutely needs a data file, even if empty testlib.config_replace('/etc/nut/dummy.dev', ''' ups.mfr: Dummy Manufacturer ups.model: Dummy UPS ups.status: OL # Set a big enough timer to avoid value reset, due to reading loop TIMER 600 ''') testlib.config_replace('/etc/nut/nut.conf', '''MODE=standalone''') # Add known friendly IP names for localhost v4 and v6 # FIXME: find a way to determine if v4 / v6 are enabled, and a way to # get v4 / v6 names testlib.config_replace(self.hosts_file, '''# 127.0.0.1 localv4 ::1 localv6 ''', append=True) if self.lsb_release['Release'] <= 8.04: testlib.config_replace('/etc/default/nut', '''# START_UPSD=yes UPSD_OPTIONS="" START_UPSMON=yes UPSMON_OPTIONS="" ''', append=False) # Start the framework self._restart() def _tearDown(self): '''Clean up after each test_* function''' self._stop() time.sleep(2) os.unlink('/etc/nut/ups.conf') os.unlink('/etc/nut/upsd.conf') os.unlink('/etc/nut/upsd.users') os.unlink('/etc/nut/upsmon.conf') os.unlink('/etc/nut/dummy.dev') os.unlink('/etc/nut/nut.conf') testlib.config_restore('/etc/nut/ups.conf') testlib.config_restore('/etc/nut/upsd.conf') testlib.config_restore('/etc/nut/upsd.users') testlib.config_restore('/etc/nut/upsmon.conf') testlib.config_restore('/etc/nut/dummy.dev') testlib.config_restore('/etc/nut/nut.conf') if os.path.exists(self.notifyscript): os.unlink(self.notifyscript) if os.path.exists(self.shutdowncmd): os.unlink(self.shutdowncmd) testlib.config_restore(self.hosts_file) if self.lsb_release['Release'] <= 8.04: testlib.config_restore('/etc/default/nut') if os.path.exists(self.tmpdir): testlib.recursive_rm(self.tmpdir) # this is needed because of the potentially hung upsd process in the # CVE-2012-2944 test testlib.cmd(['killall', 'upsd']) testlib.cmd(['killall', '-9', 'upsd']) def _start(self): '''Start NUT''' rc, report = testlib.cmd([self.initscript, 'start']) expected = 0 result = 'Got exit code %d, expected %d\n' % (rc, expected) self.assertEquals(expected, rc, result + report) time.sleep(2) def _stop(self): '''Stop NUT''' rc, report = testlib.cmd([self.initscript, 'stop']) expected = 0 result = 'Got exit code %d, expected %d\n' % (rc, expected) self.assertEquals(expected, rc, result + report) def _reload(self): '''Reload NUT''' rc, report = testlib.cmd([self.initscript, 'force-reload']) expected = 0 result = 'Got exit code %d, expected %d\n' % (rc, expected) self.assertEquals(expected, rc, result + report) def _restart(self): '''Restart NUT''' self._stop() time.sleep(2) self._start() def _status(self): '''NUT Status''' rc, report = testlib.cmd([self.initscript, 'status']) expected = 0 if self.lsb_release['Release'] <= 8.04: self._skipped("init script does not support status command") expected = 1 result = 'Got exit code %d, expected %d\n' % (rc, expected) self.assertEquals(expected, rc, result + report) def _testDaemons(self, daemons): '''Daemons running''' for d in daemons: # A note on the driver pid file: its name is # -.pid # ex: dummy-dev1-dummy-ups.pid if d == 'dummy-ups' : pidfile = os.path.join(self.rundir, 'dummy-ups-dummy-dev1.pid') else : pidfile = os.path.join(self.rundir, d + '.pid') warning = "Could not find pidfile '" + pidfile + "'" self.assertTrue(os.path.exists(pidfile), warning) self.assertTrue(testlib.check_pidfile(d, pidfile), d + ' is not running') def _nut_setvar(self, var, value): '''Test upsrw''' rc, report = testlib.cmd(['/bin/upsrw', '-s', var + '=' + value, '-u', 'admin' , '-p', 'dummypass', 'dummy-dev1@localhost']) self.assertTrue(rc == 0, 'upsrw: ' + report) return rc,report class BasicTest(NutTestCommon, PrivateNutTest): '''Test basic NUT functionalities''' def setUp(self): '''Setup mechanisms''' NutTestCommon._setUp(self) def tearDown(self): '''Shutdown methods''' NutTestCommon._tearDown(self) def test_daemons_service(self): '''Test daemons using "service status"''' self._status() def test_daemons_pid(self): '''Test daemons using PID files''' # upsmon does not work because ups-client is still missing daemons = [ 'dummy-ups', 'upsd'] self._testDaemons(daemons) def test_upsd_IPv4(self): '''Test upsd IPv4 reachability''' rc, report = testlib.cmd(['/bin/upsc', '-l', 'localv4']) self.assertTrue('dummy-dev1' in report, 'dummy-dev1 should be present in device(s) listing: ' + report) def test_upsd_IPv6(self): '''Test upsd IPv6 reachability''' rc, report = testlib.cmd(['/bin/upsc', '-l', 'localv6']) self.assertTrue('dummy-dev1' in report, 'dummy-dev1 should be present in device(s) listing: ' + report) def test_upsc_device_list(self): '''Test NUT client interface (upsc): device(s) listing''' rc, report = testlib.cmd(['/bin/upsc', '-L']) self.assertTrue('dummy-dev1: simulation device' in report, 'dummy-dev1 should be present in device(s) listing: ' + report) def _test_upsc_status(self): '''Test NUT client interface (upsc): data access''' rc, report = testlib.cmd(['/bin/upsc', 'dummy-dev1', 'ups.status']) self.assertTrue('OL' in report, 'UPS Status: ' + report + 'should be OL') #def test_upsc_powerchain(self): # '''Test NUT client interface (upsc): Powerchain(s) listing''' # rc, report = testlib.cmd(['/bin/upsc', '-p']) # Result == Main ; dummy-dev1 ; $hostname # self.assertTrue('dummy-dev1' in report, 'dummy-dev1 should be present in device(s) listing: ' + report) def test_upsrw(self): '''Test upsrw''' # Set ups.status to OB (On Battery)... self._nut_setvar('ups.model', 'Test') time.sleep(2) # and check the result on the client side rc, report = testlib.cmd(['/bin/upsc', 'dummy-dev1@localhost', 'ups.model']) self.assertTrue('Test' in report, 'UPS Model: ' + report + 'should be Test') # FIXME: need a simulation counterpart, not yet implemented #def test_upscmd(self): # '''Test upscmd''' def test_upsmon_notif(self): '''Test upsmon notifications''' # Set ups.status to OB (On Battery)... self._nut_setvar('ups.status', 'OB') time.sleep(1) # and check the result on the client side rc, report = testlib.cmd(['/bin/upsc', 'dummy-dev1@localhost', 'ups.status']) self.assertTrue('OB' in report, 'UPS Status: ' + report + 'should be OB') #def test_upsmon_shutdown(self): # '''Test upsmon basic shutdown (single UPS, low battery status)''' # self._nut_setvar('ups.status', 'OB LB') # time.sleep(2) # # and check the result on the client side # rc, report = testlib.cmd(['/bin/upsc', 'dummy-dev1@localhost', 'ups.status']) # self.assertTrue('OB LB' in report, 'UPS Status: ' + report + 'should be OB LB') # # FIXME: improve with a 2 sec loop * 5 tries # time.sleep(3) # # Check for powerdownflag and shutdowncmd (needed for halt!) # # FIXME: replace by a call to 'upsmon -K' # self.assertTrue(os.path.exists(self.powerdownflag), 'POWERDOWNFLAG has not been set!') # self.assertTrue(os.path.exists(self.shutdowncmd), 'SHUTDOWNCMD has not been executed!') def test_CVE_2012_2944(self): '''Test CVE-2012-2944''' self.tmpdir = tempfile.mkdtemp(dir='/tmp', prefix="testlib-") # First send bad input. We need to do this in a script because python # functions don't like our embedded NULs script = os.path.join(self.tmpdir, 'script.sh') contents = '''#!/bin/sh printf '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\n' | nc -q 1 127.0.0.1 3493 sleep 1 dd if=/dev/urandom count=64 | nc -q 1 127.0.0.1 3493 ''' testlib.create_fill(script, contents, mode=0755) rc, report = testlib.cmd([script]) # It should not have crashed. Let's see if it did self._testDaemons(['upsd']) self.assertTrue('ERR UNKNOWN-COMMAND' in report, "Could not find 'ERR UNKNOWN-COMMAND' in:\n%s" % report) # This CVE may also result in a hung upsd. Try to kill it, if it is # still around, it is hung testlib.cmd(['killall', 'upsd']) pidfile = os.path.join(self.rundir, 'upsd.pid') self.assertFalse(os.path.exists(pidfile), "Found %s" % pidfile) self.assertFalse(testlib.check_pidfile('upsd', pidfile), 'upsd is hung') #subprocess.call(['bash']) # FIXME #class AdvancedTest(NutTestCommon, PrivateNutTest): # '''Test advanced NUT functionalities''' if __name__ == '__main__': suite = unittest.TestSuite() # more configurable if (len(sys.argv) == 1 or sys.argv[1] == '-v'): suite.addTest(unittest.TestLoader().loadTestsFromTestCase(BasicTest)) # Pull in private tests #if use_private: # suite.addTest(unittest.TestLoader().loadTestsFromTestCase(MyPrivateTest)) else: print '''Usage: test-nut.py [-v] basic tests ''' sys.exit(1) rc = unittest.TextTestRunner(verbosity=2).run(suite) if not rc.wasSuccessful(): sys.exit(1) debian/tests/control0000644000000000000000000000012112244455113011726 0ustar Tests: nut Depends: python-unit, nut-server, nut-client Restrictions: needs-root debian/rules0000755000000000000000000001237412260241132010246 0ustar #!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk include /usr/share/cdbs/1/class/python-module.mk DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null) # List any files which are not installed include /usr/share/cdbs/1/rules/utils.mk common-binary-post-install-arch:: list-missing DEB_CONFIGURE_PREFIX := DEB_CONFIGURE_SYSCONFDIR := /etc/nut DEB_CONFIGURE_INCLUDEDIR := /usr/include DEB_CONFIGURE_MANDIR := /usr/share/man DEB_CONFIGURE_EXTRA_FLAGS := --libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \ --with-ssl --with-nss \ --with-cgi \ --with-dev \ --enable-static \ --with-statepath=/var/run/nut \ --with-altpidpath=/var/run/nut \ --with-drvpath=/lib/nut \ --with-cgipath=/usr/lib/cgi-bin/nut \ --with-htmlpath=/usr/share/nut/www \ --with-pidpath=/var/run/nut \ --datadir=/usr/share/nut \ --with-pkgconfig-dir=/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig \ --with-user=nut --with-group=nut ifeq (linux,$(DEB_HOST_ARCH_OS)) DEB_CONFIGURE_EXTRA_FLAGS+=--with-udev-dir=/lib/udev --with-systemdsystemunitdir=/lib/systemd/system endif # only build documentation if asciidoc is installed ifneq ($(shell which asciidoc),) DEB_CONFIGURE_EXTRA_FLAGS+=--with-doc=html-chunked,pdf endif common-install-arch:: # install the bash completion script mkdir -p $(CURDIR)/debian/tmp/usr/share/bash-completion/completions/ cp $(CURDIR)/scripts/misc/nut.bash_completion \ $(CURDIR)/debian/tmp/usr/share/bash-completion/completions/nut # install the avahi service file mkdir -p $(CURDIR)/debian/tmp/etc/avahi/services cp $(CURDIR)/scripts/avahi/nut.service \ $(CURDIR)/debian/tmp/etc/avahi/services # install Augeas lenses mkdir -p $(CURDIR)/debian/tmp/usr/share/augeas/lenses/dist/tests cp $(CURDIR)/scripts/augeas/*.aug \ $(CURDIR)/debian/tmp/usr/share/augeas/lenses/dist/ cp $(CURDIR)/scripts/augeas/tests/test_nut.aug \ $(CURDIR)/debian/tmp/usr/share/augeas/lenses/dist/tests/ # install the default configuration for f in $(CURDIR)/debian/tmp/etc/nut/*; do \ nf=`basename $${f} | sed 's/\(.*\).sample/\1/'`; \ mv $${f} $(CURDIR)/debian/tmp/etc/nut/$${nf}; \ done # Move -dev file to /usr mv $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libupsclient.a \ $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libupsclient.a rm -f $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/libupsclient.so ln -s /lib/$(DEB_HOST_MULTIARCH)/libupsclient.so.3 \ $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libupsclient.so # Install systemd files only on systems where it's supported ifeq (linux,$(DEB_HOST_ARCH_OS)) install -m 644 -D $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/systemd/system/nut-monitor.service \ $(CURDIR)/debian/nut-client/lib/systemd/system/nut-monitor.service install -D $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/systemd/system-shutdown/nutshutdown \ $(CURDIR)/debian/nut-server/lib/systemd/system-shutdown/nutshutdown install -m 644 -D $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/systemd/system/nut-driver.service \ $(CURDIR)/debian/nut-server/lib/systemd/system/nut-driver.service install -m 644 -D $(CURDIR)/debian/tmp/lib/$(DEB_HOST_MULTIARCH)/systemd/system/nut-server.service \ $(CURDIR)/debian/nut-server/lib/systemd/system/nut-server.service # Install tmpfiles config file to create /run/nut directory install -m 644 -D $(CURDIR)/debian/nut-client.tmpfiles \ $(CURDIR)/debian/nut-client/usr/lib/tmpfiles.d/nut-client.conf install -m 644 -D $(CURDIR)/debian/nut-server.tmpfiles \ $(CURDIR)/debian/nut-server/usr/lib/tmpfiles.d/nut-server.conf endif # install apport hooks install -D -m 644 debian/source_nut.py $(CURDIR)/debian/tmp/usr/share/apport/package-hooks/source_nut-server.py install -D -m 644 debian/source_nut.py $(CURDIR)/debian/tmp/usr/share/apport/package-hooks/source_nut-client.py common-install-indep:: #install documentation mkdir -p $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/pdf mkdir -p $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/html cp $(CURDIR)/docs/*.pdf $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/pdf cp $(CURDIR)/docs/FAQ.html $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/html for f in $(CURDIR)/docs/*.chunked/; do \ nf=`basename $${f} | sed 's/\(.*\)\.chunked/\1/'`; \ cp -a $${f} $(CURDIR)/debian/tmp/usr/share/doc/nut-doc/html/$${nf}/; \ done # install apport hooks install -D -m 644 debian/source_nut.py $(CURDIR)/debian/tmp/usr/share/apport/package-hooks/source_nut.py binary-install/nut-monitor:: dh_python2 -pnut-monitor DEB_DH_INSTALLINIT_ARGS_nut-server := --init-script=nut-server --restart-after-upgrade DEB_DH_INSTALLINIT_ARGS_nut-client := --init-script=nut-client --restart-after-upgrade DEB_DH_SYSTEMD_START_ARGS_nut-server := --restart-after-upgrade DEB_DH_SYSTEMD_START_ARGS_nut-client := --restart-after-upgrade DEB_DH_COMPRESS_ARGS_nut-doc := -X.pdf ifeq (linux,$(DEB_HOST_ARCH_OS)) # for Debian # DEB_DH_GENCONTROL_ARGS := -- -Vudev="udev (>= 0.124-1)" # for Ubuntu DEB_DH_GENCONTROL_ARGS := -- -Vudev="udev (>= 136-1)" endif debian/source/0000755000000000000000000000000012244455113010467 5ustar debian/source/format0000644000000000000000000000001412244455113011675 0ustar 3.0 (quilt) debian/gbp.conf0000644000000000000000000000023312244455113010604 0ustar [DEFAULT] debian-branch = debian upstream-branch = upstream pristine-tar = True [git-buildpackage] tarball-dir = ../tarballs/ export-dir = ../build-area/ debian/nut-server.postrm0000644000000000000000000000147512244455113012556 0ustar #!/bin/sh -e case "$1" in remove) # remove sample file if those were previously (wrongly) installed for file in ups.conf upsd.conf upsmon.conf upsd.users upssched.conf ; do rm -f /etc/nut/${file}.sample done ;; purge) # remove udev rules files rm -f /etc/udev/rules.d/025_nut-usbups.rules rm -f /etc/udev/rules.d/52_nut-usbups.rules rm -f /etc/udev/rules.d/52-nut-usbups.rules # handle a dpkg bug [ -d /etc/nut ] && rmdir --ignore-fail-on-non-empty /etc/nut >/dev/null 2>&1 ;; upgrade) # do nothing ;; failed-upgrade) # do nothing ;; abort-install) # do nothing ;; abort-upgrade) # do nothing ;; disappear) # do nothing ;; *) echo "$0: incorrect arguments: $*" >&2 exit 1 ;; esac #DEBHELPER# exit 0 debian/nut-server.manpages0000644000000000000000000000416412244455113013023 0ustar debian/tmp/usr/share/man/man5/ups.conf.5 debian/tmp/usr/share/man/man5/upsd.conf.5 debian/tmp/usr/share/man/man5/upsd.users.5 debian/tmp/usr/share/man/man8/apcsmart.8 debian/tmp/usr/share/man/man8/apcsmart-old.8 debian/tmp/usr/share/man/man8/bcmxcp.8 debian/tmp/usr/share/man/man8/bcmxcp_usb.8 debian/tmp/usr/share/man/man8/belkin.8 debian/tmp/usr/share/man/man8/belkinunv.8 debian/tmp/usr/share/man/man8/bestfcom.8 debian/tmp/usr/share/man/man8/bestuferrups.8 debian/tmp/usr/share/man/man8/bestups.8 debian/tmp/usr/share/man/man8/bestfortress.8 debian/tmp/usr/share/man/man8/clone.8 debian/tmp/usr/share/man/man8/dummy-ups.8 debian/tmp/usr/share/man/man8/etapro.8 debian/tmp/usr/share/man/man8/everups.8 debian/tmp/usr/share/man/man8/gamatronic.8 debian/tmp/usr/share/man/man8/genericups.8 debian/tmp/usr/share/man/man8/isbmex.8 debian/tmp/usr/share/man/man8/ivtscd.8 debian/tmp/usr/share/man/man8/liebert.8 debian/tmp/usr/share/man/man8/liebert-esp2.8 debian/tmp/usr/share/man/man8/masterguard.8 debian/tmp/usr/share/man/man8/metasys.8 debian/tmp/usr/share/man/man8/mge-shut.8 debian/tmp/usr/share/man/man8/mge-utalk.8 debian/tmp/usr/share/man/man8/microdowell.8 debian/tmp/usr/share/man/man8/nutupsdrv.8 debian/tmp/usr/share/man/man8/oneac.8 debian/tmp/usr/share/man/man8/optiups.8 debian/tmp/usr/share/man/man8/powercom.8 debian/tmp/usr/share/man/man8/powerpanel.8 debian/tmp/usr/share/man/man8/rhino.8 debian/tmp/usr/share/man/man8/richcomm_usb.8 debian/tmp/usr/share/man/man8/safenet.8 debian/tmp/usr/share/man/man8/solis.8 debian/tmp/usr/share/man/man8/tripplite.8 debian/tmp/usr/share/man/man8/tripplitesu.8 debian/tmp/usr/share/man/man8/tripplite_usb.8 debian/tmp/usr/share/man/man8/upscode2.8 debian/tmp/usr/share/man/man8/upsd.8 debian/tmp/usr/share/man/man8/upsdrvctl.8 debian/tmp/usr/share/man/man8/usbhid-ups.8 debian/tmp/usr/share/man/man8/victronups.8 debian/tmp/usr/share/man/man8/al175.8 debian/tmp/usr/share/man/man8/apcupsd-ups.8 debian/tmp/usr/share/man/man8/blazer_ser.8 debian/tmp/usr/share/man/man8/blazer_usb.8 debian/tmp/usr/share/man/man8/nutdrv_qx.8 debian/tmp/usr/share/man/man8/riello_ser.8 debian/tmp/usr/share/man/man8/riello_usb.8 debian/nut-ipmi.manpages0000644000000000000000000000005412244455113012445 0ustar debian/tmp/usr/share/man/man8/nut-ipmipsu.8 debian/nut-doc.install0000644000000000000000000000004212244455113012124 0ustar debian/tmp/usr/share/doc/nut-doc/ debian/source_nut.py0000644000000000000000000000277112260230776011742 0ustar #!/usr/bin/python '''nut Apport interface Copyright (C) 2010 Canonical Ltd. Author: Chuck Short 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; either version 2 of the License, or (at your option) any later version. See http://www.gnu.org/copyleft/gpl.html for the full text of the license. ''' from apport.hookutils import * def add_info(report,ui): response = ui.yesno("The contents of your nut configuration files may help developers diagnose your bug more quickly, however, it may contain sensitive information. Do you want to include it in your bug report?") if response == None: #use cancelled raise StropIteration elif response == True: attach_file(report, '/etc/nut/ups.conf', 'UpsConf') elif response == False: ui.information("The contents of your nut configuration files will NOT be included in the bug report") report['USBDevices'] = command_output(['lsusb']) packages = ['nut', 'nut-client','nut-server', 'nut-cgi', 'nut-snmp', 'nut-hal-drivers', 'nut-xml', 'libupsclient1', 'libupsclient1-dev', 'python-nut', 'nut-monitor'] versions = '' for package in packages: try: version = packaging.get_version(package) except ValueError: version = 'N/A' if version is None: version = 'N/A' versions += '%s %s\n' %(package, version) report['NutInstalledVersions'] = versions report['KernelVersion'] = command_output(['uname', '-a']) debian/nut-cgi.manpages0000644000000000000000000000041212244455113012247 0ustar debian/tmp/usr/share/man/man5/hosts.conf.5 debian/tmp/usr/share/man/man5/upsset.conf.5 debian/tmp/usr/share/man/man5/upsstats.html.5 debian/tmp/usr/share/man/man8/upsimage.cgi.8 debian/tmp/usr/share/man/man8/upsset.cgi.8 debian/tmp/usr/share/man/man8/upsstats.cgi.8 debian/watch0000644000000000000000000000012712244455113010220 0ustar version=3 http://www.networkupstools.org/download.html .*/nut-(.*)\.tar\.(?:gz|bz2|xz) debian/nut-client.preinst0000644000000000000000000000147012244455113012661 0ustar #!/bin/sh set -e # Revert /etc/nut/nut.conf mangling done by older versions of the postinst # See #677054 # changed configfile created by a fresh install in lenny, upgraded to squeeze if [ "$1" = "install" -o "$1" = "upgrade" ] \ && dpkg --compare-versions "$2" lt "2.6.4-2" \ && [ -f /etc/nut/nut.conf ] \ && [ "`md5sum /etc/nut/nut.conf | cut -d ' ' -f 1`" = 331cca39153f451c2968f4b734c1cf3f ]; then sed -i '29,$ d' /etc/nut/nut.conf fi # changed configfile created by a fresh install in squeeze if [ "$1" = "install" -o "$1" = "upgrade" ] \ && dpkg --compare-versions "$2" lt "2.6.4-2" \ && [ -f /etc/nut/nut.conf ] \ && [ "`md5sum /etc/nut/nut.conf | cut -d ' ' -f 1`" = f9b571ae65952e3a761fac2202633478 ]; then sed -i 's/^MODE=none$/MODE = none/' /etc/nut/nut.conf fi #DEBHELPER# debian/nut-snmp.docs0000644000000000000000000000001612244455113011617 0ustar docs/snmp.txt debian/nut-monitor.menu0000644000000000000000000000033312244455113012347 0ustar ?package(nut-monitor): needs="X11" section="Applications/System/Monitoring"\ title="NUT Monitor" command="/usr/bin/NUT-Monitor"\ icon="/usr/share/pixmaps/nut-monitor.xpm"\ longtitle="Network UPS Tools GUI client" debian/libups-nut-perl.install0000644000000000000000000000005212244455113013616 0ustar scripts/perl/Nut.pm /usr/share/perl5/UPS/