Difference between revisions of "Ifplugd"

From CBLFS
Jump to navigationJump to search
(I added the ifplugd package.)
 
 
(7 intermediate revisions by 3 users not shown)
Line 7: Line 7:
 
----
 
----
  
== Introduction to ifplugd ==
+
{{Package-Introduction|'''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.
  
'''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.|http://0pointer.de/lennart/projects/ifplugd/}}
 
 
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 ==
 
== Dependencies ==
Line 19: Line 15:
 
=== Required ===
 
=== Required ===
 
* [[Libdaemon]]
 
* [[Libdaemon]]
 +
* [[Pkg-config]]
 
=== 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 ==
  
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 41:
 
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 68:
 
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 81:
 
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:
 
 
 
  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 ===
 
=== 64Bit ===
Line 162: Line 94:
 
Compile the package:
 
Compile the package:
  
  ./configure PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" \
+
PKG_CONFIG_PATH="${PKG_CONFIG_PATH64}" CC="gcc ${BUILS64}" \
    CC="gcc ${BUILD64}" --prefix=/usr --libdir=/lib64 \
+
./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:
+
== Configuring ifplugd ==
  
  rm -v /etc/rc.d/*/K80network
+
=== Configuration File ===
  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.
+
/etc/ifplugd/ifplugd.conf
  
  rm -v /etc/rc.d/init.d/network
+
=== Bootscript ===
  
Create the links necessary to have ifplugd actually run:
+
In '''ifplugd.conf''', set INTERFACES to the network interfaces that you have on your computer (e.g. eth0).
  
  ln -sv ../init.d/ifplugd /etc/rc.d/rc1.d/K80ifplugd
+
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.
  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:
+
Remove unnecessary links from the [[bootscripts]]:
  
  sed -i 's@/sbin/@/etc/sysconfig/network-devices/@g' /etc/ifplugd/ifplugd.action
+
rm -v /etc/rc.d/*/K80network
 +
rm -v /etc/rc.d/*/S20network
  
== Configuring ifplugd ==
+
If you want, you can remove the network bootscript, but if you decide you want it, you'll have to reinstall it from the clfs-bootscripts package.
  
=== Configuration File ===
+
rm -v /etc/rc.d/init.d/network
  
/etc/ifplugd/ifplugd.conf
+
Create the links necessary to have ifplugd actually run:
  
=== Configuration Information ===
+
ln -sv ../init.d/ifplugd /etc/rc.d/rc1.d/K75ifplugd
 +
ln -sv ../init.d/ifplugd /etc/rc.d/rc2.d/S25ifplugd
 +
ln -sv ../init.d/ifplugd /etc/rc.d/rc3.d/S25ifplugd
 +
ln -sv ../init.d/ifplugd /etc/rc.d/rc4.d/S25ifplugd
 +
ln -sv ../init.d/ifplugd /etc/rc.d/rc5.d/S25ifplugd
 +
ln -sv ../init.d/ifplugd /etc/rc.d/rc6.d/K75ifplugd
  
In ifplugd.conf, set INTERFACES to the network interfaces that you have on your computer (e.g. eth0).
+
Alter /etc/ifplugd/ifplugd.action so that it points to the correct location for the '''ifdown''' and '''ifup''' scripts:
  
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.
+
sed -i 's@/sbin/@/etc/sysconfig/network-devices/@g' /etc/ifplugd/ifplugd.action
  
 
= Contents =
 
= Contents =
Line 232: Line 164:
 
| is an utility which may be used to detect the link status of a local Linux ethernet device.
 
| is an utility which may be used to detect the link status of a local Linux ethernet device.
 
|}
 
|}
 +
 +
[[Category:Network Utilities]]

Latest revision as of 16:16, 19 March 2009

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.

Project Homepage: http://0pointer.de/lennart/projects/ifplugd/

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

Bootscript

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 bootscripts:

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

If you want, you can remove the network bootscript, but if you decide you want it, 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/K75ifplugd
ln -sv ../init.d/ifplugd /etc/rc.d/rc2.d/S25ifplugd
ln -sv ../init.d/ifplugd /etc/rc.d/rc3.d/S25ifplugd
ln -sv ../init.d/ifplugd /etc/rc.d/rc4.d/S25ifplugd
ln -sv ../init.d/ifplugd /etc/rc.d/rc5.d/S25ifplugd
ln -sv ../init.d/ifplugd /etc/rc.d/rc6.d/K75ifplugd

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=17669"