summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2003-10-17 00:09:23 +0000
committerLennart Poettering <lennart@poettering.net>2003-10-17 00:09:23 +0000
commit6abfd933e73966931fb37471f15f91ffc42c23b6 (patch)
treeb9e6ffc80b22f403debe3b52f7d3cf4182caa2ad
parent3466defa6628261499d050c92769beacb9dd792e (diff)
many fixes
git-svn-id: file:///home/lennart/svn/public/ifplugd/trunk@52 2bf48fe7-cfc1-0310-909f-d9042e1e0fef
-rw-r--r--configure.ac4
-rw-r--r--doc/README.html.in55
-rw-r--r--man/Makefile.am4
-rw-r--r--man/ifplugd.8.xml.in4
-rw-r--r--man/ifplugd.conf.5.xml.in4
-rw-r--r--man/ifstatus.8.xml.in4
-rw-r--r--man/xmltoman.css (renamed from man/man.css)0
-rw-r--r--man/xmltoman.xsl (renamed from man/man.xsl)0
-rw-r--r--src/ifplugd.c13
9 files changed, 49 insertions, 39 deletions
diff --git a/configure.ac b/configure.ac
index 24e03e5..82b583d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,7 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
AC_PREREQ(2.57)
-AC_INIT([ifplugd], [0.17b], [mzvscyhtq (at) 0pointer (dot) de])
+AC_INIT([ifplugd], [0.18], [mzvscyhtq (at) 0pointer (dot) de])
AC_CONFIG_SRCDIR([src/ifplugd.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign -Wall])
@@ -36,7 +36,7 @@ if test "x$GCC" = "xyes" ; then
CFLAGS="$CFLAGS -pipe -Wall"
fi
-if test -d /usr/local/stow ; then
+if type -p stow > /dev/null && test -d /usr/local/stow ; then
AC_MSG_NOTICE([*** Found /usr/local/stow: installing to /usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION} ***])
AC_PREFIX_DEFAULT([/usr/local/stow/${PACKAGE_NAME}-${PACKAGE_VERSION}])
fi
diff --git a/doc/README.html.in b/doc/README.html.in
index ca9d27e..b3f0b4d 100644
--- a/doc/README.html.in
+++ b/doc/README.html.in
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="iso-8895-15"?> <!-- -*-html-helper-*- -->
+<?xml version="1.0" encoding="iso-8859-1"?> <!-- -*-html-helper-*- -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
@@ -42,6 +42,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</p>
<h2><a name="news">News</a></h2>
+<div class="news-date">Fri Oct 17 2003: </div> <p class="news-text"><a
+href="@PACKAGE_URL@ifplugd-0.18.tar.gz">Version
+0.18</a> released, changes include: Some bugs fixed</p>
+
<div class="news-date">Fri Sep 13 2003: </div> <p class="news-text"><a
href="@PACKAGE_URL@ifplugd-0.17b.tar.gz">Version
0.17b</a> released, changes include: typo and date fix</p>
@@ -70,10 +74,10 @@ suspending/resuming, many fixes</p>
configure your ethernet device when a cable is plugged in and
automatically unconfigure it if the cable is pulled. This is useful on
laptops with onboard network adapters, since it will only configure
-the interface when a cable is really connected.
+the interface when a cable is really connected.</p>
-<p><tt>ifplugd</tt> is a rather simplistic approach to this target since it relies
-on your distribution's native interface configuration system.</p>
+<p><tt>ifplugd</tt> ifplugd interfaces with your distribution's native network
+ configuration utilities.</p>
<p>Some features:</p>
@@ -89,11 +93,12 @@ on your distribution's native interface configuration system.</p>
<li>Syslog support</li>
- <li>Simplistic C source code, just 19k binary (+11k for libdaemon)</li>
+ <li>Small program - the binary is just 19 KB (plus 11 KB for <tt>libdaemon</tt>).</li>
<li>Multiple ethernet interface support</li>
- <li>May ignore short unplugged whiles (<tt>-d</tt> option) or plugged whiles (<tt>-u</tt>
+ <li>Can be configured to ignore short "unplugged" periods
+ (-d option) or short "plugged" periods(<tt>-u</tt>
option)</li>
<li>Support for wireless networking. Whenever an AP is detected the
@@ -104,17 +109,17 @@ network is configured.</li>
<h2><a name="status">Status</a></h2>
-<p>Version 0.14 is stable and has all the sensible features its users could think of.</p>
+<p>Version @PACKAGE_VERSION@ is stable and has all the sensible features its users could think of.</p>
<h2><a name="documentation">Documentation</a></h2>
-<p>Have a look on the man pages <a href="@PACKAGE_URL@ifplugd.8.xml"><tt>ifplugd(8)</tt></a>, <a href="@PACKAGE_URL@ifstatus.8.xml"><tt>ifstatus(8)</tt></a>, <a href="@PACKAGE_URL@ifplugd.conf.5.xml"><tt>ifplugd.conf(5)</tt></a>. (A XSLT capable browser is required)</p>
+<p>Have a look on the man pages <a href="@PACKAGE_URL@ifplugd.8.xml"><tt>ifplugd(8)</tt></a>, <a href="@PACKAGE_URL@ifstatus.8.xml"><tt>ifstatus(8)</tt></a>, <a href="@PACKAGE_URL@ifplugd.conf.5.xml"><tt>ifplugd.conf(5)</tt></a>. (An XSLT capable browser is required)</p>
<h3>Configuration</h3>
<p>Edit <tt>/etc/ifplugd/ifplugd.conf</tt> for configuration
changes. This file is a bourne shell script sourced by the init script
-and used to generate a suiting command line. You may specify more than
+and used to start <tt>ifplugd</tt> with appropriate arguments. You may specify more than
one ethernet interface in <tt>INTERFACES</tt>. For each interface a
seperate instance of <tt>ifplugd</tt> is spawned. The arguments specified in
<tt>ARGS</tt> are append to <tt>ifplugd</tt>'s command line. Have a look on
@@ -123,10 +128,11 @@ about the available options.</p>
<p>The network interface which is controlled by <tt>ifplugd</tt>
should not be configured automatically by your distribution's network
-subsystem, since <tt>ifplugd</tt> will do this for you if needed. On
-Debian remove interface names beginning with <tt>eth</tt> or
-<tt>wlan</tt> from the <tt>auto</tt> option line in
-<tt>/etc/network/interfaces</tt>.</p>
+subsystem, since <tt>ifplugd</tt> will do this for you if needed.
+
+<p>On Debian systems, any interfaces named in ifplugd's
+<tt>INTERFACES</tt> environment variable should not also be listed in
+an "auto" stanza in <tt>/etc/network/interfaces</tt>.</p>
<h3>Troubleshooting</h3>
@@ -147,11 +153,11 @@ detect the network cable for a short period of time before and after
the suspend. When using the <tt>-f</tt> switch, this will be treated
as "no link beat", thus the network is shutdown after a
timeout. During this timeout the machine changes to suspended
-state. When it is resumed again, the timeout will be run out, the
-network is deconfigured, however, as the next cable detection
-succeeds, the network is configured again immediately. To fix this
-problem, <tt>ifplugd</tt> should be disabled before the APM suspend
-and enabled back after the suspend. This may be done by using
+state. When it is resumed again, the timeout period will have expired
+and so the network is deconfigured, however, as the next cable
+detection succeeds, the network is configured again immediately. To
+fix this problem, <tt>ifplugd</tt> should be disabled before the APM
+suspend and enabled back after the suspend. This may be done by using
<tt>apmd</tt> and adding a script to
<tt>/etc/apm/{suspend,resume}.d</tt> which simply calls
<tt>/etc/init.d/ifplugd suspend</tt>, resp. <tt>/etc/init.d/ifplugd
@@ -213,8 +219,13 @@ exist on
<li><p><b>Q:</b> There are already <tt>laptop-net</tt>'s <tt>ifd</tt> and <tt>miid</tt>, why did you write
your own daemon?</p>
- <p><b>A:</b> <tt>laptop-net</tt> simply sucks and I didn't know of <tt>miid</tt> when I wrote
- <tt>ifplugd</tt>. However, <tt>ifplugd</tt> is far better than <tt>miid</tt>. For a
+ <p><b>A:</b> <tt>laptop-net</tt> was too integrated with its profile
+system and didn't work on my hardware when I had a look on it. It
+seemed easier to me to write a simple but feature complete replacement
+than using laptop-net without most of the special features disabled. I
+didn't know about <tt>miid</tt> when I wrote
+ <tt>ifplugd</tt>, but in any case <tt>ifplugd</tt> is much better
+than <tt>miid</tt>. For a
comparison of <tt>miid</tt> and <tt>ifplugd</tt>, have a look on
<a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=162763&amp;repeatmerged=yes">http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=162763&amp;repeatmerged=yes</a></p></li>
@@ -260,7 +271,7 @@ on their source codes for learning how to use the link beat ioctls.</p>
<p>Oliver Kurth for packaging <tt>ifplugd</tt> for Debian and <tt>ifplugd</tt>'s
manpage</p>
-<p>Asgeir Nilsen, Sean Reifschneider, R. Steve McKown, David Mitchell for patches</p>
+<p>Thomas Hood, Asgeir Nilsen, Sean Reifschneider, R. Steve McKown, David Mitchell for patches</p>
<p>Frederic Lepied for integrating <tt>ifplugd</tt> into Mandrake Linux</p>
@@ -277,7 +288,7 @@ manpage</p>
<p>Packages for Mandrake Linux may be found in the Cooker distribution; Gentoo packages are available as well</p>
<hr/>
-<address>Lennart Poettering &lt;@PACKAGE_BUGREPORT@&gt;, July 2003</address>
+<address>Lennart Poettering &lt;@PACKAGE_BUGREPORT@&gt;, October 2003</address>
<div><i>$Id$</i></div>
</body>
diff --git a/man/Makefile.am b/man/Makefile.am
index 742e3bf..b6e4c3a 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,4 +1,4 @@
-# $Id: Makefile.am 22 2003-06-15 16:36:33Z lennart $
+# $Id$
# This file is part of ifplugd.
#
@@ -20,7 +20,7 @@ man_MANS = ifplugd.8 ifplugd.conf.5 ifstatus.8
noinst_DATA = ifplugd.8.xml ifplugd.conf.5.xml ifstatus.8.xml
-EXTRA_DIST = $(man_MANS) ifplugd.8.xml.in ifplugd.conf.5.xml.in ifstatus.8.xml.in man.css man.xsl
+EXTRA_DIST = $(man_MANS) ifplugd.8.xml.in ifplugd.conf.5.xml.in ifstatus.8.xml.in xmltoman.css xmltoman.xsl
CLEANFILES = ifplugd.8.xml ifplugd.conf.5.xml ifstatus.8.xml
diff --git a/man/ifplugd.8.xml.in b/man/ifplugd.8.xml.in
index d259608..dbb2255 100644
--- a/man/ifplugd.8.xml.in
+++ b/man/ifplugd.8.xml.in
@@ -1,6 +1,6 @@
<?xml version="1.0" standalone='no'?>
-<!DOCTYPE manpage SYSTEM "man.dtd">
-<?xml-stylesheet type="text/xsl" href="man.xsl" ?>
+<!DOCTYPE manpage SYSTEM "xmltoman.dtd">
+<?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
<!-- $Id$ -->
diff --git a/man/ifplugd.conf.5.xml.in b/man/ifplugd.conf.5.xml.in
index 563a489..0728701 100644
--- a/man/ifplugd.conf.5.xml.in
+++ b/man/ifplugd.conf.5.xml.in
@@ -1,6 +1,6 @@
<?xml version="1.0" standalone='no'?>
-<!DOCTYPE manpage SYSTEM "man.dtd">
-<?xml-stylesheet type="text/xsl" href="man.xsl" ?>
+<!DOCTYPE manpage SYSTEM "xmltoman.dtd">
+<?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
<!-- $Id$ -->
diff --git a/man/ifstatus.8.xml.in b/man/ifstatus.8.xml.in
index 61b246a..bbcf14b 100644
--- a/man/ifstatus.8.xml.in
+++ b/man/ifstatus.8.xml.in
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
-<!DOCTYPE manpage SYSTEM "man.dtd">
-<?xml-stylesheet type="text/xsl" href="man.xsl" ?>
+<!DOCTYPE manpage SYSTEM "xmltoman.dtd">
+<?xml-stylesheet type="text/xsl" href="xmltoman.xsl" ?>
<!-- $Id$ -->
diff --git a/man/man.css b/man/xmltoman.css
index 0892e4f..0892e4f 100644
--- a/man/man.css
+++ b/man/xmltoman.css
diff --git a/man/man.xsl b/man/xmltoman.xsl
index e633de1..e633de1 100644
--- a/man/man.xsl
+++ b/man/xmltoman.xsl
diff --git a/src/ifplugd.c b/src/ifplugd.c
index 18c883b..322870f 100644
--- a/src/ifplugd.c
+++ b/src/ifplugd.c
@@ -221,8 +221,6 @@ int action(interface_status_t status) {
daemon_log(LOG_WARNING, "Killing child.");
kill(pid, SIGTERM);
}
-
- break;
}
}
@@ -579,7 +577,7 @@ void work(void) {
}
cleanup:
- if (!no_shutdown_script && status == IFSTATUS_UP) {
+ if (!no_shutdown_script && (status == IFSTATUS_UP || (status == IFSTATUS_DOWN && t))) {
setenv(IFPLUGD_ENV_PREVIOUS, strstatus(status), 1);
setenv(IFPLUGD_ENV_CURRENT, strstatus(-1), 1);
action(IFSTATUS_DOWN);
@@ -833,12 +831,13 @@ void parse_args(int argc, char *argv[]) {
if (_check) {
pid_t pid = daemon_pid_file_is_running();
- if (pid == (pid_t) -1)
+ if (pid == (pid_t) -1 || pid == 0) {
printf("ifplugd not running.\n");
- else
+ exit(255);
+ } else {
printf("ifplugd process for device %s running as pid %u.\n", interface, pid);
-
- exit(pid == 0 ? 255 : 0);
+ exit(0);
+ }
}
}