--- netplug-1.2.9.1.orig/main.c +++ netplug-1.2.9.1/main.c @@ -38,6 +38,7 @@ int use_syslog; +int ignore; static char *pid_file; static int @@ -71,7 +72,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; } @@ -161,7 +162,7 @@ ce.pid = info->si_pid; ret = waitpid(info->si_pid, &ce.status, 0); if (ret == info->si_pid) - write(child_handler_pipe[1], &ce, sizeof(ce)); + ignore = write(child_handler_pipe[1], &ce, sizeof(ce)); } /* Poll the existing interface state, so we can catch any state --- netplug-1.2.9.1.orig/debian/copyright +++ netplug-1.2.9.1/debian/copyright @@ -0,0 +1,35 @@ +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. --- netplug-1.2.9.1.orig/debian/docs +++ netplug-1.2.9.1/debian/docs @@ -0,0 +1,3 @@ +README +TODO +NEWS --- netplug-1.2.9.1.orig/debian/control +++ netplug-1.2.9.1/debian/control @@ -0,0 +1,19 @@ +Source: netplug +Section: net +Priority: optional +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Philipp Matthias Hahn +Build-Depends: debhelper (>> 7) +Standards-Version: 3.8.3 +Homepage: http://www.red-bean.com/~bos/ + +Package: netplug +Architecture: any +Depends: ${shlibs: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. --- netplug-1.2.9.1.orig/debian/rules +++ netplug-1.2.9.1/debian/rules @@ -0,0 +1,69 @@ +#!/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 build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + $(MAKE) clean + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + + #$(MAKE) prefix=$(CURDIR)/debian/netplug initdir='$(prefix)/etc/init.d' scriptdir='$(prefix)/etc/netplug' install + install -m 755 netplugd debian/netplug/sbin + install -m 644 etc/netplugd.conf debian/netplug/etc/netplug + install -m 755 scripts/netplug debian/netplug/etc/netplug + #install -m 644 man/man8/netplugd.8 debian/netplug/usr/share/man/man8/netplugd.8 + #gzip -9 debian/netplug/usr/share/man/man8/netplugd.8 + +# 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_installman man/man8/netplugd.8 + 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 --- netplug-1.2.9.1.orig/debian/init.d +++ netplug-1.2.9.1/debian/init.d @@ -0,0 +1,53 @@ +#! /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=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/sbin/netplugd +NAME=netplugd +DESC="network plug daemon" + +test -x "$DAEMON" || exit 0 + +set -e + +case "$1" in + start) + echo -n "Starting $DESC: " + start-stop-daemon --start --quiet --pidfile /var/run/"$NAME".pid \ + --exec "$DAEMON" -- -p /var/run/"$NAME".pid >/dev/null + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + start-stop-daemon --stop --quiet --pidfile /var/run/"$NAME".pid \ + --name "$NAME" + echo "$NAME." + ;; + restart|force-reload) + echo -n "Restarting $DESC: " + start-stop-daemon --stop --quiet --pidfile /var/run/"$NAME".pid \ + --name "$NAME" + sleep 1 + start-stop-daemon --start --quiet --pidfile /var/run/"$NAME".pid \ + --exec "$DAEMON" -- -p /var/run/"$NAME".pid >/dev/null + echo "$NAME." + ;; + *) + N=/etc/init.d/"$NAME" + echo "Usage: $N {start|stop|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 --- netplug-1.2.9.1.orig/debian/changelog +++ netplug-1.2.9.1/debian/changelog @@ -0,0 +1,96 @@ +netplug (1.2.9.1-2ubuntu1) lucid; urgency=low + + * Merge from Debian testing. Remaining changes: + - Capture and ignore return value of write to fix FTBFS. + + -- Stefan Lesicnik Wed, 20 Jan 2010 11:00:33 +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-1ubuntu1) karmic; urgency=low + + * Capture and ignore return value of write to fix FTBFS. + + -- Stefan Lesicnik Sun, 18 Oct 2009 11:51:10 +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 + --- netplug-1.2.9.1.orig/debian/watch +++ netplug-1.2.9.1/debian/watch @@ -0,0 +1,5 @@ +# 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 --- netplug-1.2.9.1.orig/debian/dirs +++ netplug-1.2.9.1/debian/dirs @@ -0,0 +1,2 @@ +etc/netplug +sbin --- netplug-1.2.9.1.orig/debian/compat +++ netplug-1.2.9.1/debian/compat @@ -0,0 +1 @@ +7 --- 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 --- 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