Difference between revisions of "Ifplugd"

From CBLFS
Jump to navigationJump to search
Line 19: Line 19:
 
=== Required ===
 
=== Required ===
 
* [[Libdaemon]]
 
* [[Libdaemon]]
 +
* [[Pkg-config]]
 
=== Optional ===
 
=== Optional ===
 
* [[xmltoman]] (for rebuilding the man pages)
 
* [[xmltoman]] (for rebuilding the man pages)
Line 26: Line 27:
 
== Additional Configuration Options ==
 
== Additional Configuration Options ==
  
If you don't have lynx installed, pass the following flag to configure:
+
If you don't have [[Lynx]] installed, pass the following flag to configure:
  
 
  --disable-lynx
 
  --disable-lynx
  
If you don't have xmltoman installed, pass the following flag to configure:
+
If you don't have [[xmltoman]] installed, pass the following flag to configure:
  
 
  --disable-xmltoman
 
  --disable-xmltoman
  
If you don't have subversion installed, pass the following flag to configure:
+
If you don't have [[Subversion]] installed, pass the following flag to configure:
  
 
  --disable-subversion
 
  --disable-subversion
Line 44: Line 45:
 
Compile the package:
 
Compile the package:
  
  ./configure --prefix=/usr --sysconfdir=/etc --sbindir=/sbin
+
./configure --prefix=/usr --sysconfdir=/etc \
  make
+
    --sbindir=/sbin
 +
make
  
 
Install the package:
 
Install the package:
  
  make install
+
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 ===
 
=== Command Explanations ===
Line 92: Line 72:
 
Compile the package:
 
Compile the package:
  
  ./configure PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" \
+
PKG_CONFIG_PATH="${PKG_CONFIG_PATH32}" CC="gcc ${BUILD32}" \
    CC="gcc ${BUILD32}" --prefix=/usr \
+
./configure --prefix=/usr --sysconfdir=/etc \
    --sysconfdir=/etc --sbindir=/sbin
+
    --sbindir=/sbin &&
  make
+
make
  
 
Install the package:
 
Install the package:
  
  make install
+
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 ===
 
=== N32 ===
Line 127: Line 85:
 
Compile the package:
 
Compile the package:
  
  ./configure PKG_CONFIG_PATH="${PKG_CONFIG_PATHN32}" \
+
PKG_CONFIG_PATH="${PKG_CONFIG_PATHN32}" CC="gcc ${BUILDN32}" \
    CC="gcc ${BUILDN32}" --prefix=/usr --libdir=/lib32 \
+
./configure --prefix=/usr --sysconfdir=/etc \
    --sysconfdir=/etc --sbindir=/sbin
+
    --sbindir=/sbin &&
  make
+
make
  
 
Install the package:
 
Install the package:
  
  make install
+
make install
  
Remove unnecessary links from the clfs-bootscripts:
+
=== 64Bit ===
  
  rm -v /etc/rc.d/*/K80network
+
Compile the package:
  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.
+
PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" CC="gcc ${BUILS64}" \
 +
./configure --prefix=/usr --sysconfdir=/etc \
 +
    --sbindir=/sbin &&
 +
make
  
  rm -v /etc/rc.d/init.d/network
+
Install the package:
  
Create the links necessary to have ifplugd actually run:
+
make install
  
  ln -sv ../init.d/ifplugd /etc/rc.d/rc1.d/K80ifplugd
+
== Configuring ifplugd ==
  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:
+
=== Configuration File ===
  
  sed -i 's@/sbin/@/etc/sysconfig/network-devices/@g' /etc/ifplugd/ifplugd.action
+
/etc/ifplugd/ifplugd.conf
  
=== 64Bit ===
+
=== Configuration Information ===
  
Compile the package:
+
In ifplugd.conf, set INTERFACES to the network interfaces that you have on your computer (e.g. eth0).
  
  ./configure PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" \
+
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.
    CC="gcc ${BUILD64}" --prefix=/usr --libdir=/lib64 \
 
    --sysconfdir=/etc --sbindir=/sbin
 
  make
 
 
 
Install the package:
 
 
 
  make install
 
  
 
Remove unnecessary links from the clfs-bootscripts:
 
Remove unnecessary links from the clfs-bootscripts:
  
  rm -v /etc/rc.d/*/K80network
+
rm -v /etc/rc.d/*/K80network
  rm -v /etc/rc.d/*/S20network
+
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.
 
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
+
rm -v /etc/rc.d/init.d/network
  
 
Create the links necessary to have ifplugd actually run:
 
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/rc1.d/K80ifplugd
  ln -sv ../init.d/ifplugd /etc/rc.d/rc2.d/S20ifplugd
+
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/rc3.d/S20ifplugd
  ln -sv ../init.d/ifplugd /etc/rc.d/rc4.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/rc5.d/S20ifplugd
  ln -sv ../init.d/ifplugd /etc/rc.d/rc6.d/K80ifplugd
+
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:
 
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
+
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 =
 
= Contents =

Revision as of 13:08, 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

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:

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

Install the package:

make install

N32

Compile the package:

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

Install the package:

make install

64Bit

Compile the package:

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

Install the package:

make install

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.

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

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.
Retrieved from "?title=Ifplugd&oldid=6693"