debian/0000755000000000000000000000000011427273316007174 5ustar debian/copyright0000644000000000000000000000257711427241654011142 0ustar This package was debianized by Philipp Matthias Hahn on Mon, 1 Sep 2003 22:22:43 +0200. The current Debian maintainer is Philipp Matthias Hahn It was downloaded from http://www.red-bean.com/~bos/ Upstream Author: Bryan O'Sullivan Copyright: Copyright 2003 Key Research, Inc. Copyright 2003 Pathscale, Inc. Copyright 2003, 2004, 2005 Bryan O'Sullivan Copyright 2003 Jeremy Fitzhardinge 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. 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 with the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL-2; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. On Debian systems, the complete text of the GNU General Public License, version 2, can be found in /usr/share/common-licenses/GPL-2. The Debian packaging is (C) 2008, Philipp Matthias Hahn is licensed under the GPL, see above. debian/changelog0000644000000000000000000000602611427273316011052 0ustar netplug (1.2.9.2-1) unstable; urgency=low * New upstream version: - Fixes FTBFS caused by -Werror and ignored return value (Closes: #559924) * debian/init.d: - Drop "set -e" and add --oknodo to fix restart (Closes: #589617) - Use LSB log_* functions. - Drop /usr/local and /usr from PATH. * debian/control: - Switch to 3.0 quilt format. - Update to Standards-Version: 3.9.1: no changes. - Add misc:Depends * debian/rules: Fix quoting of $$. * main.c: Fix log spamming (Closes: #569226) -- Philipp Matthias Hahn Sat, 07 Aug 2010 13:58:21 +0200 netplug (1.2.9.1-2) unstable; urgency=low * main.c: Make "Logs all ignored events" LOG_DEBUG (Closes: #544069) * debian/init.d: - use --name instead of --exec to fix "initscript: stop action does not work" (Closes: #531087) - change LSBInitScript dependencies. * Update debian/control: Standards-Version: 3.8.3: no changes. -- Philipp Matthias Hahn Wed, 07 Oct 2009 08:43:55 +0200 netplug (1.2.9.1-1) unstable; urgency=low * New upstream version. - includes socketlen_t fix. -- Philipp Matthias Hahn Tue, 07 Apr 2009 08:45:41 +0200 netplug (1.2.9-3) unstable; urgency=low * debian/control: Fix description (Closes: #513031) * man/man8/netplugd.8: Fix path to init.d (Closes: #513032) * Update debian/control: - Standards-Version: 3.8.1 - Use debhelper v7 (+ debian/compat) * debian/copyright: Change link from GPL to GPL-2 * debian/rules: s/dh_clean -k/dh_prep/ -- Philipp Matthias Hahn Tue, 07 Apr 2009 00:16:04 +0200 netplug (1.2.9-2) unstable; urgency=low * Improve rejected debian/copyright. -- Philipp Matthias Hahn Tue, 09 Sep 2008 21:47:19 +0200 netplug (1.2.9-1) unstable; urgency=low * New upstream version. - includes PID-file fix. * Update debian/control: - Standards-Version: 3.8.0 - Homepage-field - Compare to ifplugd in Description * Update debian/init.d: - Add init-info for dependency-based booting * Add debian/watch -- Philipp Matthias Hahn Wed, 30 Jul 2008 18:31:51 +0200 netplug (1.2.7-2) unstable; urgency=low * main.c: Write PID-file after damon()izing. -- Philipp Matthias Hahn Fri, 7 Jan 2005 10:08:11 +0100 netplug (1.2.7-1) unstable; urgency=low * New upstream version. * debian/init.d: Fix pid-file handling. * debian/control: Add Homepage-location to description. -- Philipp Matthias Hahn Fri, 13 Aug 2004 09:31:41 +0200 netplug (1.2-2) unstable; urgency=low * Fix name of netplugd in init.d script. -- Philipp Matthias Hahn Sun, 4 Jul 2004 20:05:59 +0200 netplug (1.2-1) unstable; urgency=low * New upstream version. * Update download location. -- Philipp Matthias Hahn Thu, 25 Sep 2003 19:58:22 +0200 netplug (1.0-1) unstable; urgency=low * Initial Release. -- Philipp Matthias Hahn Mon, 1 Sep 2003 22:22:43 +0200 debian/dirs0000644000000000000000000000002111427241654010051 0ustar etc/netplug sbin debian/compat0000644000000000000000000000000211427241654010372 0ustar 7 debian/watch0000644000000000000000000000024011427241654010221 0ustar # Compulsory line, this is a version 3 file version=3 # Uncomment to examine a Webserver directory http://www.red-bean.com/~bos/netplug/netplug-(.*)\.tar\.bz2 debian/docs0000644000000000000000000000002111427241654010040 0ustar README TODO NEWS debian/source/0000755000000000000000000000000011427241654010474 5ustar debian/source/format0000644000000000000000000000001411427241654011702 0ustar 3.0 (quilt) debian/rules0000755000000000000000000000237011427272456010262 0ustar #!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif build: build-stamp build-stamp: dh_testdir $(MAKE) initdir='$$(prefix)/etc/init.d' scriptdir='$$(prefix)/etc/netplug' touch $@ clean: dh_testdir dh_testroot $(RM) build-stamp $(MAKE) clean dh_clean install: build dh_testdir dh_testroot dh_prep dh_installdirs $(MAKE) DESTDIR=$(CURDIR)/debian/netplug initdir='$$(prefix)/etc/init.d' scriptdir='$$(prefix)/etc/netplug' install $(RM) $(CURDIR)/debian/netplug/etc/init.d/netplugd # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installinit dh_link dh_strip dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install debian/init.d0000644000000000000000000000474711427241654010320 0ustar #! /bin/sh ### BEGIN INIT INFO # Provides: netplug # Required-Start: $local_fs # Required-Stop: $local_fs # Should-Start: $network $syslog # Should-Stop: $network $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Brings up/down network automatically # Description: Brings networks interfaces up and down automatically when # the cable is removed / inserted ### END INIT INFO PATH=/sbin:/bin DAEMON=/sbin/netplugd NAME=netplugd DESC="network plug daemon" PIDFILE=/var/run/$NAME.pid test -x "$DAEMON" || exit 0 # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh # Define LSB log_* functions. # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. . /lib/lsb/init-functions do_start () { # Return # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started start-stop-daemon --start --quiet --pidfile "$PIDFILE" \ --exec "$DAEMON" --test >/dev/null || return 1 start-stop-daemon --start --quiet --pidfile "$PIDFILE" \ --exec "$DAEMON" -- -p "$PIDFILE" >/dev/null || return 2 } do_stop () { # Return # 0 if daemon has been stopped # 1 if daemon was already stopped # 2 if daemon could not be stopped # other if a failure occurred local RETVAL start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile "$PIDFILE" --name "$NAME" RETVAL="$?" [ "$RETVAL" = 2 ] && return 2 start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec "$DAEMON" [ "$?" = 2 ] && return 2 return "$RETVAL" } case "$1" in start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME" do_start case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; stop) [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; esac ;; status) status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? ;; restart|force-reload) log_daemon_msg "Restarting $DESC" "$NAME" do_stop case "$?" in 0|1) sleep 1 do_start case "$?" in 0) log_end_msg 0 ;; 1) log_end_msg 1 ;; # Old process is still running *) log_end_msg 1 ;; # Failed to start esac ;; *) # Failed to stop log_end_msg 1 ;; esac ;; *) N=/etc/init.d/"$NAME" echo "Usage: $N {start|stop|status|restart|force-reload}" >&2 exit 3 ;; esac exit 0 # vim:set ft=sh sw=4 ts=4: debian/patches/0002755000000000000000000000000011427267555010635 5ustar debian/patches/10loglevel.patch0000644000000000000000000000054111427241654013616 0ustar Hide log-spamming message of ignored events. (Bug #544069) --- netplug-1.2.9.1.orig/main.c +++ netplug-1.2.9.1/main.c @@ -71,7 +71,7 @@ char *name = RTA_DATA(attrs[IFLA_IFNAME]); if (!if_match(name)) { - do_log(LOG_INFO, "%s: ignoring event", name); + do_log(LOG_DEBUG, "%s: ignoring event", name); return 0; } debian/patches/20quoting.patch0000644000000000000000000000146411427241654013501 0ustar Properly quote interface names. --- netplug-1.2.9.1.orig/scripts/netplug +++ netplug-1.2.9.1/scripts/netplug @@ -25,7 +25,7 @@ case "$action" in in) if [ -x /sbin/ifup ]; then - exec /sbin/ifup $dev + exec /sbin/ifup "$dev" else echo "Please teach me how to plug in an interface!" 1>&2 exit 1 @@ -35,14 +35,14 @@ if [ -x /sbin/ifdown ]; then # At least on Fedora Core 1, the call to ip addr flush infloops # /sbin/ifdown $dev && exec /sbin/ip addr flush $dev - exec /sbin/ifdown $dev + exec /sbin/ifdown "$dev" else echo "Please teach me how to unplug an interface!" 1>&2 exit 1 fi ;; probe) - exec /sbin/ip link set $dev up >/dev/null 2>&1 + exec /sbin/ip link set "$dev" up >/dev/null 2>&1 ;; *) echo "I have been called with a funny action of '%s'!" 1>&2 debian/patches/30path.patch0000644000000000000000000000070611427241654012746 0ustar Fix Debian specific path to init script in manual page. (Bug #513032) --- netplug-1.2.9.1.orig/man/man8/netplugd.8 +++ netplug-1.2.9.1/man/man8/netplugd.8 @@ -165,7 +165,7 @@ events. The command is run synchronously; it must exit with status code 0 if it succeeds, otherwise with a non-zero exit code or signal. .El -.It Pa /etc/rc.d/init.d/netplugd +.It Pa /etc/init.d/netplug The .Xr init 8 script that starts, stops, and displays status of the debian/patches/series0000644000000000000000000000007711427267555012054 0ustar 10loglevel.patch 20quoting.patch 30path.patch 40callback.patch debian/patches/40callback.patch0000664000000000000000000000136111427267467013561 0ustar Fix WIRELESS messages spamming syslog. (Bug #569226) Some wireless network drivers send RTM_NEWLINK messages without a IFNAME, for which netplug each time prints two error messages to syslog. Search for "netlink wireless IFNAME" or for example see http://lists.shmoo.com/pipermail/hostap/2004-March/006227.html Change the debug level from ERROR to DEBUG and return success. --- a/main.c +++ b/main.c @@ -64,8 +64,8 @@ handle_interface(struct nlmsghdr *hdr, v parse_rtattrs(attrs, IFLA_MAX, IFLA_RTA(info), len); if (attrs[IFLA_IFNAME] == NULL) { - do_log(LOG_ERR, "No interface name"); - return -1; + do_log(LOG_DEBUG, "No interface name"); + return 0; } char *name = RTA_DATA(attrs[IFLA_IFNAME]); debian/control0000644000000000000000000000116011427267247010603 0ustar Source: netplug Section: net Priority: optional Maintainer: Philipp Matthias Hahn Build-Depends: debhelper (>> 7) Standards-Version: 3.9.1 Homepage: http://www.red-bean.com/~bos/ Package: netplug Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, iproute Description: network link monitor daemon This daemon monitors the link status of network cards and configures the network on plug- and un-plug-events. . It's similar to ifplugd, but uses NETLINK instead of regularly polling the link status. This improves power-consumption with laptops, but does not work with all network card.