[Summary/RFC] (Network script) Simplifying the LFS Bootscripts

iLya S. Potrepalov uhj at mail.ru
Mon Jan 10 07:31:07 PST 2005

Nathan Coulson wrote:

> Networking will be left as is.  [except for the hotplug check, I am
> going to take that out (Unless someone here says they actually use
> it), as well as moving the ONBOOT check to network].

As for me, I need one interface up in every runlevel (displayless firewall),
so I prefer delete 'network' and replace it with 'interface':

# Begin $rc_base/init.d/interface
. /etc/sysconfig/rc

interface=${0##*/??[SKHIR]-} # I use letter [SKHIR] as suffix, not as prefix

case "${1}" in
 start) IN_BOOT=1 ${network_devices}/ifup ${interface}
 stop)  IN_BOOT=1 ${network_devices}/ifdown ${interface}
   exec ${0} stop
   sleep 1
   exec ${0} start
   # in many cases '/etc/rc.d/init.d/something status' run by hand, not by
   if [ "${interface}" == "${rc_base}/init.d/interface" ]; then
     ip -v link show "${2}"
     ip -v link show "${interface}"

 *) echo "Usage: ${0} {start|stop|restart|status}"

# End $rc_base/init.d/interface

and in right places put symlinks:

rcsysinit.d/60S-lo -> ../init.d/interface
rcsysinit.d/70S-eth0 -> ../init.d/interface

rc3.d/10S-eth1 -> ../init.d/interface

rc1.d/80K-eth1 -> ../init.d/interface

and so on..


More information about the lfs-dev mailing list