Difference between revisions of "Ifplugd"

From CBLFS
Jump to navigationJump to search
(I added the ifplugd package.)
 
Line 21: Line 21:
 
=== Optional ===
 
=== Optional ===
 
* [[xmltoman]] (for rebuilding the man pages)
 
* [[xmltoman]] (for rebuilding the man pages)
* [[subversion]] (for rebuilding svn-release.h)
+
* [[Subversion]] (for rebuilding svn-release.h)
* [[lynx]] (for regenerating the README)
+
* [[Lynx]] (for regenerating the README)
  
 
== Additional Configuration Options ==
 
== Additional Configuration Options ==

Revision as of 14:01, 7 January 2007

Download Source: http://0pointer.de/lennart/projects/ifplugd/ifplugd-0.28.tar.gz

Introduction to ifplugd

ifplugd is a Linux daemon which will automatically 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.

With the clfs-bootscripts, you will get an ethernet connection if the cable is connected when you boot, but otherwise will not - even if you connect the cable later. With ifplugd, you will have a connection whenever the cable is connected - regardless of whether it was connected on boot or how many times you unplug and plug it back in after booting.

ifplugd also works with wireless devices. See http://0pointer.de/lennart/projects/ifplugd/ for more details.

Dependencies

Required

Optional

  • xmltoman (for rebuilding the man pages)
  • Subversion (for rebuilding svn-release.h)
  • Lynx (for regenerating the README)

Additional Configuration Options

If you don't have lynx installed, pass the following flag to configure:

--disable-lynx

If you don't have xmltoman installed, pass the following flag to configure:

--disable-xmltoman

If you don't have subversion installed, pass the following flag to configure:

--disable-subversion

Nothing bad happens if you don't have one of the optional packages and you forget to pass the disabling flag, but configure will complain with a warning.

Non-Multilib

Compile the package:

 ./configure --prefix=/usr --sysconfdir=/etc --sbindir=/sbin
 make

Install the package:

 make install

Remove unnecessary links from the clfs-bootscripts:

 rm -v /etc/rc.d/*/K80network
 rm -v /etc/rc.d/*/S20network

You won't need it, so you can removed the actual network script if you want, but then if you decide you want it, then you'll have to reinstall it from the clfs-bootscripts package.

 rm -v /etc/rc.d/init.d/network

Create the links necessary to have ifplugd actually run:

 ln -sv ../init.d/ifplugd /etc/rc.d/rc1.d/K80ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc2.d/S20ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc3.d/S20ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc4.d/S20ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc5.d/S20ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc6.d/K80ifplugd

Alter /etc/ifplugd/ifplugd.action so that it points to the correct location for the ifdown and ifup scripts:

 sed -i 's@/sbin/@/etc/sysconfig/network-devices/@g' /etc/ifplugd/ifplugd.action

Command Explanations

--sysconfdir=/etc: We use this flag because the default is /usr/etc which you probably don't want to happen.

--sbindir=/sbin: We use this flag because the default is /usr/sbin and you may want ifplugd to be available even when /usr is on another partition.

rm -v ....: The ifplugd script effectively replaces clfs-bootscripts' network script, so we need to remove the network script (or at least its links in /etc/rc.d/rcX.d) so that they won't try to run.

ln -sv ....: We need to have links in the /etc/rc.d/rcX.d directories in order for ifplugd to run.

sed -i ....: ifplugd.action points to /sbin for the ifdown and ifup scripts, but on clfs systems, they reside in /etc/sysconfig/network-devices, so we need to redirect it.

Multilib

This package does not provide any libraries so only one installation is needed.

32Bit

Compile the package:

 ./configure PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" \
   CC="gcc ${BUILD32}" --prefix=/usr \
   --sysconfdir=/etc --sbindir=/sbin
 make

Install the package:

 make install

Remove unnecessary links from the clfs-bootscripts:

 rm -v /etc/rc.d/*/K80network
 rm -v /etc/rc.d/*/S20network

You won't need it, so you can removed the actual network script if you want, but then if you decide you want it, then you'll have to reinstall it from the clfs-bootscripts package.

 rm -v /etc/rc.d/init.d/network

Create the links necessary to have ifplugd actually run:

 ln -sv ../init.d/ifplugd /etc/rc.d/rc1.d/K80ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc2.d/S20ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc3.d/S20ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc4.d/S20ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc5.d/S20ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc6.d/K80ifplugd

Alter /etc/ifplugd/ifplugd.action so that it points to the correct location for the ifdown and ifup scripts:

 sed -i 's@/sbin/@/etc/sysconfig/network-devices/@g' /etc/ifplugd/ifplugd.action

N32

Compile the package:

 ./configure PKG_CONFIG_PATH="${PKG_CONFIG_PATHN32}" \
   CC="gcc ${BUILDN32}" --prefix=/usr --libdir=/lib32 \
   --sysconfdir=/etc --sbindir=/sbin
 make

Install the package:

 make install

Remove unnecessary links from the clfs-bootscripts:

 rm -v /etc/rc.d/*/K80network
 rm -v /etc/rc.d/*/S20network

You won't need it, so you can removed the actual network script if you want, but then if you decide you want it, then you'll have to reinstall it from the clfs-bootscripts package.

 rm -v /etc/rc.d/init.d/network

Create the links necessary to have ifplugd actually run:

 ln -sv ../init.d/ifplugd /etc/rc.d/rc1.d/K80ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc2.d/S20ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc3.d/S20ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc4.d/S20ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc5.d/S20ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc6.d/K80ifplugd

Alter /etc/ifplugd/ifplugd.action so that it points to the correct location for the ifdown and ifup scripts:

 sed -i 's@/sbin/@/etc/sysconfig/network-devices/@g' /etc/ifplugd/ifplugd.action

64Bit

Compile the package:

 ./configure PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" \
   CC="gcc ${BUILD64}" --prefix=/usr --libdir=/lib64 \
   --sysconfdir=/etc --sbindir=/sbin
 make

Install the package:

 make install

Remove unnecessary links from the clfs-bootscripts:

 rm -v /etc/rc.d/*/K80network
 rm -v /etc/rc.d/*/S20network

You won't need it, so you can removed the actual network script if you want, but then if you decide you want it, then you'll have to reinstall it from the clfs-bootscripts package.

 rm -v /etc/rc.d/init.d/network

Create the links necessary to have ifplugd actually run:

 ln -sv ../init.d/ifplugd /etc/rc.d/rc1.d/K80ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc2.d/S20ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc3.d/S20ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc4.d/S20ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc5.d/S20ifplugd
 ln -sv ../init.d/ifplugd /etc/rc.d/rc6.d/K80ifplugd

Alter /etc/ifplugd/ifplugd.action so that it points to the correct location for the ifdown and ifup scripts:

 sed -i 's@/sbin/@/etc/sysconfig/network-devices/@g' /etc/ifplugd/ifplugd.action

Configuring ifplugd

Configuration File

/etc/ifplugd/ifplugd.conf

Configuration Information

In ifplugd.conf, set INTERFACES to the network interfaces that you have on your computer (e.g. eth0).

Also, if you want to pass ifplugd parameters other than the defaults, you need to set ARGS (also within ifplugd.conf) to the parameters that you actually want. However, the defaults are probably sufficient.

Contents

Installed Programs: ifplugd, ifplugstatus
Installed Libraries: None
Installed Scripts: ifplugd
Installed Directory: /etc/ifplugd

Short Descriptions

ifplugd is a daemon which will automatically configure your ethernet device when a cable is plugged in and automatically unconfigure it if the cable is pulled.
ifplugstatus is an utility which may be used to detect the link status of a local Linux ethernet device.