mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-06-18 19:29:21 +01:00
Lots of spelling fixes.
Delete the no longer used lsb-bootscripts directory git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@9967 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
parent
d7f2eb08da
commit
cb02946abf
@ -43,7 +43,7 @@
|
|||||||
* lfs/init.d/rc: Correct double interactive prompt and set prompt defaults
|
* lfs/init.d/rc: Correct double interactive prompt and set prompt defaults
|
||||||
* lfs/init.d/setclock: Remove screen output from start case (udev)
|
* lfs/init.d/setclock: Remove screen output from start case (udev)
|
||||||
* lfs/init.d/udev{,_retry}: Restore output to screen and log
|
* lfs/init.d/udev{,_retry}: Restore output to screen and log
|
||||||
* lfs/sbin/ifup: Change "..." to ": " (not awaiting additonal output)
|
* lfs/sbin/ifup: Change "..." to ": " (not awaiting additional output)
|
||||||
|
|
||||||
2011-11-14 Bruce Dubbs <bdubbs@linuxfromscratch.org>
|
2011-11-14 Bruce Dubbs <bdubbs@linuxfromscratch.org>
|
||||||
|
|
||||||
@ -85,7 +85,7 @@
|
|||||||
** Add /etc/sysconfig/init_params for adding environmental parameters
|
** Add /etc/sysconfig/init_params for adding environmental parameters
|
||||||
to all functions used in bootscripts
|
to all functions used in bootscripts
|
||||||
** Move network configuration to /etc/sysconfig/ifconfig.*. The
|
** Move network configuration to /etc/sysconfig/ifconfig.*. The
|
||||||
ifconfig files can have any extention. Use IFACE parameter to
|
ifconfig files can have any extension. Use IFACE parameter to
|
||||||
specify the target network interface within the configuration file.
|
specify the target network interface within the configuration file.
|
||||||
** Adds an optional parameter, SKIPTMPCLEAN, to skip the removal of
|
** Adds an optional parameter, SKIPTMPCLEAN, to skip the removal of
|
||||||
files in /tmp at bootup. Specify the variable in
|
files in /tmp at bootup. Specify the variable in
|
||||||
@ -125,7 +125,7 @@
|
|||||||
2009-01-02 Bruce Dubbs <bdubbs@linuxfromscratch.org>
|
2009-01-02 Bruce Dubbs <bdubbs@linuxfromscratch.org>
|
||||||
* lfs/init.d/functions:
|
* lfs/init.d/functions:
|
||||||
* lfs/sysconfig/network-devices/ifup:
|
* lfs/sysconfig/network-devices/ifup:
|
||||||
Updated line widths to accomodate pdf generation in both the above
|
Updated line widths to accommodate pdf generation in both the above
|
||||||
files.
|
files.
|
||||||
|
|
||||||
2008-10-27 DJ Lucas <dj@linuxfromscratch.org>
|
2008-10-27 DJ Lucas <dj@linuxfromscratch.org>
|
||||||
@ -354,14 +354,14 @@ n/a - February 19, 2005
|
|||||||
but required for compatibility. (Nathan Coulson)
|
but required for compatibility. (Nathan Coulson)
|
||||||
|
|
||||||
n/a - February 9, 2005
|
n/a - February 9, 2005
|
||||||
* Accidently mounted /dev with 775 instead of 755, fixed
|
* Accidentally mounted /dev with 775 instead of 755, fixed
|
||||||
(Reported by Alexander E. Patrakov)
|
(Reported by Alexander E. Patrakov)
|
||||||
|
|
||||||
n/a - February 9, 2005
|
n/a - February 9, 2005
|
||||||
* Bugfix for /dev, now mounted with 755 permission
|
* Bugfix for /dev, now mounted with 755 permission
|
||||||
|
|
||||||
n/a - February 8, 2005
|
n/a - February 8, 2005
|
||||||
* changed pidof, so it doesnt check the process id
|
* changed pidof, so it doesn't check the process id
|
||||||
of running bootscripts, and to process shell scripts
|
of running bootscripts, and to process shell scripts
|
||||||
(Nathan Coulson)
|
(Nathan Coulson)
|
||||||
|
|
||||||
@ -539,7 +539,7 @@ n/a - August 4, 2004
|
|||||||
n/a - July 31, 2004
|
n/a - July 31, 2004
|
||||||
|
|
||||||
* Moved PIDFILE check to getpids and removed arguments from
|
* Moved PIDFILE check to getpids and removed arguments from
|
||||||
killproc and reloadproc. Signals are now set at begining of
|
killproc and reloadproc. Signals are now set at beginning of
|
||||||
funtcions script with KILLDELAY. (DJ)
|
funtcions script with KILLDELAY. (DJ)
|
||||||
* Added a optional service script which can set the MTU for a given
|
* Added a optional service script which can set the MTU for a given
|
||||||
interface
|
interface
|
||||||
@ -1035,8 +1035,8 @@ n/a - January 30, 2004:
|
|||||||
|
|
||||||
* added 'restart' to the swap script
|
* added 'restart' to the swap script
|
||||||
|
|
||||||
* instead of using 'echo -n' to supress newlines so the [ OK ] and
|
* instead of using 'echo -n' to suppress newlines so the [ OK ] and
|
||||||
related messages allign properly, substitute this with a single echo
|
related messages align properly, substitute this with a single echo
|
||||||
command that simply goes one line up before outputting anything. This
|
command that simply goes one line up before outputting anything. This
|
||||||
also has the benefit that when programs have their own output (like
|
also has the benefit that when programs have their own output (like
|
||||||
swapon, fsck and loadkeys), there won't be an unwanted blank line
|
swapon, fsck and loadkeys), there won't be an unwanted blank line
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
# Should-Stop:
|
# Should-Stop:
|
||||||
# Default-Start: S
|
# Default-Start: S
|
||||||
# Default-Stop:
|
# Default-Stop:
|
||||||
# Short-Description: Replays failed uevents and creates additonal devices.
|
# Short-Description: Replays failed uevents and creates additional devices.
|
||||||
# Description: Replays any failed uevents that were skipped due to
|
# Description: Replays any failed uevents that were skipped due to
|
||||||
# slow hardware initialization, and creates those needed
|
# slow hardware initialization, and creates those needed
|
||||||
# device nodes
|
# device nodes
|
||||||
|
@ -158,7 +158,7 @@ start_daemon()
|
|||||||
|
|
||||||
0)
|
0)
|
||||||
# Program is already running correctly, this is a
|
# Program is already running correctly, this is a
|
||||||
# succesful start.
|
# successful start.
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ case "${2}" in
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "${GATEWAY}" ]; then
|
if [ -n "${GATEWAY}" ]; then
|
||||||
# Only remove the gateway if ther are no remaining ipv4 addresses
|
# Only remove the gateway if there are no remaining ipv4 addresses
|
||||||
if [ "$(ip addr show ${1} 2>/dev/null | grep 'inet ')" != "" ]; then
|
if [ "$(ip addr show ${1} 2>/dev/null | grep 'inet ')" != "" ]; then
|
||||||
log_info_msg "Removing default gateway..."
|
log_info_msg "Removing default gateway..."
|
||||||
ip route del default
|
ip route del default
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
# Interactive startup
|
# Interactive startup
|
||||||
#IPROMPT="yes" # Whether to display the interactive boot promp
|
#IPROMPT="yes" # Whether to display the interactive boot promp
|
||||||
#itime="3" # The ammount of time (in seconds) to display the prompt
|
#itime="3" # The amount of time (in seconds) to display the prompt
|
||||||
|
|
||||||
# The total length of the distro welcome string, without escape codes
|
# The total length of the distro welcome string, without escape codes
|
||||||
#wlen=$(echo "Welcome to ${DISTRO}" | wc -c )
|
#wlen=$(echo "Welcome to ${DISTRO}" | wc -c )
|
||||||
|
@ -39,6 +39,10 @@
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>2012-08-29</para>
|
<para>2012-08-29</para>
|
||||||
<itemizedlist>
|
<itemizedlist>
|
||||||
|
<listitem>
|
||||||
|
<para>[bdubbs] - Fix spelling typos. Thanks to Gilles
|
||||||
|
Espinasse.</para>
|
||||||
|
</listitem>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>[bdubbs] - Add additional explanations for time zone
|
<para>[bdubbs] - Add additional explanations for time zone
|
||||||
installation, udev, and network configuration.</para>
|
installation, udev, and network configuration.</para>
|
||||||
|
@ -105,7 +105,7 @@
|
|||||||
swapping by just listening to disk activity and observing how the system
|
swapping by just listening to disk activity and observing how the system
|
||||||
reacts to commands. The first reaction to swapping should be to check for
|
reacts to commands. The first reaction to swapping should be to check for
|
||||||
an unreasonable command such as trying to edit a five gigabyte file. If
|
an unreasonable command such as trying to edit a five gigabyte file. If
|
||||||
swapping becomes a normal occurance, the best solution is to purchase more
|
swapping becomes a normal occurrence, the best solution is to purchase more
|
||||||
RAM for your system.</para> </sect3>
|
RAM for your system.</para> </sect3>
|
||||||
|
|
||||||
<sect3>
|
<sect3>
|
||||||
|
@ -378,8 +378,8 @@ zic -d /usr/share/zoneinfo -p America/New_York</userinput></screen>
|
|||||||
<term><parameter>zic ... -p ...</parameter></term>
|
<term><parameter>zic ... -p ...</parameter></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>This creates the <filename>posixrules</filename> file. We use
|
<para>This creates the <filename>posixrules</filename> file. We use
|
||||||
New York because POSIX requites the daylight savings time rules
|
New York because POSIX requires the daylight savings time rules
|
||||||
to be unaccordance with US rules,</para>
|
to be in accordance with US rules,</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
|
@ -183,7 +183,7 @@ sed -i 's/arpd.8//' man/man8/Makefile</userinput></screen>
|
|||||||
<para><command>ip mroute</command> allows users to set, change, or
|
<para><command>ip mroute</command> allows users to set, change, or
|
||||||
delete the multicast routing</para>
|
delete the multicast routing</para>
|
||||||
|
|
||||||
<para><command>ip monitor</command> allows users to continously monitor
|
<para><command>ip monitor</command> allows users to continuously monitor
|
||||||
the state of devices, addresses and routes</para>
|
the state of devices, addresses and routes</para>
|
||||||
<indexterm zone="ch-system-iproute2 ip">
|
<indexterm zone="ch-system-iproute2 ip">
|
||||||
<primary sortas="b-ip">ip</primary>
|
<primary sortas="b-ip">ip</primary>
|
||||||
|
@ -130,7 +130,7 @@ ln -sfv ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen> -->
|
|||||||
a group of the same name as the user. By default the user ID (UID) and
|
a group of the same name as the user. By default the user ID (UID) and
|
||||||
group ID (GID) numbers will begin with 1000. This means if you don't pass
|
group ID (GID) numbers will begin with 1000. This means if you don't pass
|
||||||
parameters to <command>useradd</command>, each user will be a member of a
|
parameters to <command>useradd</command>, each user will be a member of a
|
||||||
unique group on the system. If this behaviour is undesireable, you'll need
|
unique group on the system. If this behaviour is undesirable, you'll need
|
||||||
to pass the <parameter>-g</parameter> parameter to
|
to pass the <parameter>-g</parameter> parameter to
|
||||||
<command>useradd</command>. The default parameters are stored in the
|
<command>useradd</command>. The default parameters are stored in the
|
||||||
<filename>/etc/default/useradd</filename> file. You may need to modify two
|
<filename>/etc/default/useradd</filename> file. You may need to modify two
|
||||||
|
@ -562,7 +562,7 @@ mkdir -pv /var/lib/hwclock</userinput></screen>
|
|||||||
<varlistentry id="lscpu">
|
<varlistentry id="lscpu">
|
||||||
<term><command>lscpu</command></term>
|
<term><command>lscpu</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Prints CPU architechture information</para>
|
<para>Prints CPU architecture information</para>
|
||||||
<indexterm zone="ch-system-util-linux lscpu">
|
<indexterm zone="ch-system-util-linux lscpu">
|
||||||
<primary sortas="b-lscpu">lscpu</primary>
|
<primary sortas="b-lscpu">lscpu</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
@ -1,140 +0,0 @@
|
|||||||
2011-12-23 Matt Burgess <matthew@linuxfromscratch.org>
|
|
||||||
* etc/init.d/mountvirtfs: Correct permissions on /run/shm
|
|
||||||
2011-05-23 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* Makefile, etc/default/rc: The value of ETCDIR is used to set the RC_BASE at
|
|
||||||
install time. Changed default ETCDIR to /etc/rc.d and added /etc/init.d
|
|
||||||
symlink if ETCDIR is not /etc.
|
|
||||||
* Makefile, etc/inittab: Removed the installation of /etc/inittab as this is
|
|
||||||
done in the book.
|
|
||||||
* etc/default/rc, etc/default/rc.site: Added "stop_on_error" parameter to
|
|
||||||
rc.site file and added testcase on "stop_on_error" for FAILURE_ACTION in
|
|
||||||
rc file.
|
|
||||||
|
|
||||||
2011-05-21 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* lib/lsb/init-functions: Merged the contents of etc/init.d/lfs-functions and
|
|
||||||
standardized comment headers.
|
|
||||||
* etc/init.d/lfs-functions: Removed.
|
|
||||||
* etc/default/rc, etc/default/rc.site: moved majority of etc/default/rc.site
|
|
||||||
into etc/default/rc as the configuration items are not generally user
|
|
||||||
configurable items.
|
|
||||||
* etc/init.d/udev: Changed trigger commands to use both subsystem and device
|
|
||||||
types, per udev documentation.
|
|
||||||
|
|
||||||
2011-05-18 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* sbin/ifup, sbin/ifdown: Complete rewrite for use as standalone tools.
|
|
||||||
* etc/init.d/network: Rewrote script to account for new ifup and ifdown.
|
|
||||||
|
|
||||||
2011-05-14 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* etc/default/rc.site: Added FAILURE_ACTION variable for use in remote
|
|
||||||
systems where user input is not appropriate in the event of a failure.
|
|
||||||
* etc/default/rc.site: Moved configuration of clock and hostname to rc.site
|
|
||||||
* etc/init.d/setclock: Removed provides '$time' and added provides 'hwclock'.
|
|
||||||
* etc/init.d/rc: Setup the /run mountpoint (for use by bootloging).
|
|
||||||
* sysconfig/network-devices/services/*: Moved service scripts to
|
|
||||||
/lib/network-services.
|
|
||||||
* sysconfig/network-devices/*: Moved network configuration files to
|
|
||||||
/etc/network.
|
|
||||||
* sysconfig/network-devices/*: Moved ifup and ifdown scripts to /sbin.
|
|
||||||
* sbin/ifup: Copy network configuration scritps to /run on startup.
|
|
||||||
* sbin/ifdown: Use running configuration stored in /run to stop interfaces.
|
|
||||||
* etc/sysoconfig/*: Moved sysconfig files to /etc/default.
|
|
||||||
* ect/lsb-config, lsb/manage-functions: Removed (unused).
|
|
||||||
* /: Changed layout to include full installation paths inside of archive.
|
|
||||||
|
|
||||||
2011-04-24 Bruce Dubbs <bdubbs@linuxfromscratch.org>
|
|
||||||
* init.d/mountvirtfs: Sync to LFS-Bootscripts-20110424 - Add creation of
|
|
||||||
/run/{var,lock,shm}.
|
|
||||||
* init.d/udev: Sync to LFS-Bootscripts-20110424 - Add /dev/shm -> /run/shm
|
|
||||||
symlink.
|
|
||||||
|
|
||||||
2011-04-18 Bruce Dubbs <bdubbs@linuxfromscratch.org>
|
|
||||||
* init.d/mountvirtfs: Change name from mountkernfs to mountvirtfs and added
|
|
||||||
mounting of /run filesystem.
|
|
||||||
|
|
||||||
2010-10-12 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* init.d/swap: Added udev to Required-Start.
|
|
||||||
|
|
||||||
2010-08-23 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* init.d/sendsignals: Fix missing 'then' in conditionals. Thanks to
|
|
||||||
Jeremy Huntwork for the report and correction.
|
|
||||||
|
|
||||||
2010-06-27 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* init.d/sendsignals: Sync to LFS-Bootscripts-20100627 - fix killall in new
|
|
||||||
sysvinit.
|
|
||||||
* init.d/*: Standardized syntax for integer comparisons in tests.
|
|
||||||
|
|
||||||
2010-05-29 Matthew Burgess <matthew@linuxfromscratch.org>
|
|
||||||
* init.d/udev: Only copy /lib/udev/devices/null, as Udev >= 155 copies
|
|
||||||
devices from /lib/udev/devices to /dev itself. Udevd still needs /dev/null
|
|
||||||
present before starting up though.
|
|
||||||
|
|
||||||
2010-05-29 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* init.d/udev: Sync to LFS-Bootscirpts-20100529 - Add test if /dev is already
|
|
||||||
mounted and add --action=add to udevadmin trigger (Matthew Burgess).
|
|
||||||
|
|
||||||
2010-04-27 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* init.d/*: Removed unneeded X-LFS-Default* lines.
|
|
||||||
* init.d/udev_retry: Add --action=add for udevtrigger (Bryan Kadzban)
|
|
||||||
* init.d/sysklogd: Corrected path of syslogd and klogd.
|
|
||||||
|
|
||||||
2009-03-25 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* init.d/rc: Corrected serveral echo commands missing -e flag. Thanks to
|
|
||||||
Michael Tremer at IPFire for the corrections.
|
|
||||||
|
|
||||||
2008-10-23 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* init.d/console: Removed BROKEN_COMPOSE handling because kernel patch was
|
|
||||||
accepted upstream.
|
|
||||||
|
|
||||||
2008-09-08 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* init.d/rc: Corrected echo -e command - Thanks to Michael Tremer at IPFire.
|
|
||||||
|
|
||||||
2008-09-07 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* Makefile: Use new initd-tools package to activate scripts.
|
|
||||||
* Makefile: $syslog and modules services cannot be a hard dependencies
|
|
||||||
due to minimal install target.
|
|
||||||
* init.d/rc: Store bootlog date in UTC.
|
|
||||||
* init.d/network: Added hard deps for local_fs, swap, and localnet (account
|
|
||||||
for /usr at network instead of $remote_fs).
|
|
||||||
|
|
||||||
2008-08-31 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* init.d/*: Corrected more, and minimized dependencies in scripts.
|
|
||||||
* init.d/rc: Don't try to write to bootlog in 0 and 6.
|
|
||||||
* etc/inittab: Use /etc/rcS.d instead of /etc/rcsysinit.d - added
|
|
||||||
replacement /etc/inittab file.
|
|
||||||
|
|
||||||
2008-08-30 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* init.d/*: Corrected remaining dependency errors in script headers.
|
|
||||||
|
|
||||||
2008-05-31 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* init.d/udev, init.d/udev_retry: Synced with LFS-Bootscrpts-20080531 - use
|
|
||||||
udevadm.
|
|
||||||
* lsb/manage-functions: Added additional functions.
|
|
||||||
|
|
||||||
2008-04-13 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* lsb/manage-functions: Added for use by scripts such as
|
|
||||||
{install,remove}_initd or chkconfig, that need to parse the LSB headers.
|
|
||||||
* init.d/*: Cleaned up script headers to reflect real Start or Stop.
|
|
||||||
|
|
||||||
2008-03-15 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* lsb/init-functions: Corrected test for $pidfile in pidofproc().
|
|
||||||
* init.d/lfs-functions: Replaced exit with return in statusproc().
|
|
||||||
|
|
||||||
2008-03-15 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* lsb/init-functions: Added missing 'stale pid file' checking for pidofproc().
|
|
||||||
|
|
||||||
2008-02-10 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* README, INSTALL: Updated documentation.
|
|
||||||
|
|
||||||
2007-08-20 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* init.d/*: Synced with LFS-bootscripts.
|
|
||||||
|
|
||||||
2007-07-05 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* init.d/*: Synced with LFS-bootscripts.
|
|
||||||
* init.d/rc: Removed 'stty sane' from the environment setup as it breaks
|
|
||||||
custom key configs when run from the CLI.
|
|
||||||
|
|
||||||
2007-02-18 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* init.d/*: Synced with LFS-bootscripts.
|
|
||||||
|
|
||||||
2007-02-06 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* /: Initial commit!
|
|
@ -1,979 +0,0 @@
|
|||||||
2011-04-19 Bruce Dubbs <bdubbs@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/mountvirtfs: Add creation of /run/{var,lock,shm}.
|
|
||||||
* lfs/init.d/udev: Add /dev/shm -> /run/shm symlink.
|
|
||||||
|
|
||||||
2011-04-18 Bruce Dubbs <bdubbs@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/mountvirtfs: Change name from mountkernfs to mountvirtfs.
|
|
||||||
Add mounting of /run filesystem.
|
|
||||||
|
|
||||||
2010-05-29 Matt Burgess <matthew@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/udev: Only copy /lib/udev/devices/null, as Udev >= 155 copies
|
|
||||||
devices from /lib/udev/devices to /dev itself. Udevd still needs /dev/null
|
|
||||||
present before starting up though.
|
|
||||||
|
|
||||||
2010-04-20 Bryan Kadzban <bryan@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/udev, lfs/init.d/udev_retry: Add --action=add, to handle udev
|
|
||||||
version 152 and newer, which send "change" events by default in udevtrigger
|
|
||||||
now.
|
|
||||||
|
|
||||||
2010-01-24 Matthew Burgess <matthew@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/udev: Check to see if /dev is already mounted, as it may be if
|
|
||||||
under an initramfs environment. See ticket #2550.
|
|
||||||
|
|
||||||
2009-08-14 Bryan Kadzban <bryan@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/udev_retry: Use "udevadm trigger --type=failed", which
|
|
||||||
apparently replaced "--retry-failed" some time ago. "--retry-failed" is
|
|
||||||
removed in udev-146.
|
|
||||||
|
|
||||||
2009-01-02 Bruce Dubbs <bdubbs@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/functions:
|
|
||||||
* lfs/sysconfig/network-devices/ifup:
|
|
||||||
Updated line widths to accomodate pdf generation in both the above
|
|
||||||
files.
|
|
||||||
|
|
||||||
2008-10-27 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/cleanfs: Removed '! -newer /proc' from find commands in
|
|
||||||
check for stale files in /var/lock and /var/run.
|
|
||||||
* Makefile: Reversed cleanfs and udev_retry scripts so that cleanfs
|
|
||||||
runs immediately after mountfs.
|
|
||||||
|
|
||||||
2008-10-26 Dan Nicholson <dnicholson@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/functions: Remove stale pid files when encountered
|
|
||||||
in loadproc/killproc/reloadproc. When the bootscript specifies
|
|
||||||
a pid file to use with the "-p pidfile" argument, *proc
|
|
||||||
functions previously bailed out when the referenced file
|
|
||||||
contains an invalid pid.
|
|
||||||
|
|
||||||
2008-10-23 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/console: Removed BROKEN_COMPOSE as kernel patch has
|
|
||||||
been accepted upstream.
|
|
||||||
|
|
||||||
2008-05-21 Bryan Kadzban <bryan@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/udev, lfs/init.d/udev_retry: Use new udevadm program.
|
|
||||||
|
|
||||||
2007-08-20 DJ Lucas <dj@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/setclock: Added missing 'stop' argument to usage text
|
|
||||||
|
|
||||||
2007-08-13 Dan Nicholson <dnicholson@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/checkfs: Don't suppress error messages from the screen.
|
|
||||||
|
|
||||||
2007-07-18 Dan Nicholson <dnicholson@linuxfromscratch.org>
|
|
||||||
* Makefile, lfs/init.d/consolelog: New bootscript controlling the
|
|
||||||
kernel log level on the console. This is controlled by the LOGLEVEL
|
|
||||||
variable in /etc/sysconfig/console.
|
|
||||||
* lfs/init.d/modules: Remove the log level handling since this is
|
|
||||||
done in the consolelog script now.
|
|
||||||
* lfs/init.d/modules: Clean up the script by removing the file
|
|
||||||
descriptor duplication and instead just redirecting
|
|
||||||
/etc/sysconfig/modules to the input of the while loop.
|
|
||||||
|
|
||||||
2007-06-16 Dan Nicholson <dnicholson@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/mountfs, lfs/init.d/mountkernfs, lfs/init.d/setclock,
|
|
||||||
lfs/init.d/modules, lfs/sysconfig/network-devices/if{up,down}:
|
|
||||||
Don't suppress stderr during bootscripts unless necessary. This
|
|
||||||
would prevent potentially critical messages from reaching the screen.
|
|
||||||
|
|
||||||
2007-04-24 Dan Nicholson <dnicholson@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/functions: When killproc is executed, it checks that
|
|
||||||
the process is still running, sleeps if it is, then checks again.
|
|
||||||
The sleep is 1 second in between checks. By sleeping for 0.1 seconds
|
|
||||||
in between checks, killproc is much faster as it's wasting much
|
|
||||||
less time sleeping in the normal case that the process has died
|
|
||||||
after a short delay.
|
|
||||||
|
|
||||||
2007-04-16 Dan Nicholson <dnicholson@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/functions: Redirect stderr when using kill to suppress
|
|
||||||
output.
|
|
||||||
* lfs/init.d/functions: killproc() was not handling the case where a
|
|
||||||
pidfile is passed to the function. The logic with the signal to be
|
|
||||||
used was causing issues with the handling of pidfiles. This has been
|
|
||||||
fixes, and now killproc() will recheck the process if the signal
|
|
||||||
was TERM (the default) or KILL.
|
|
||||||
* lfs/init.d/functions: statusproc() has been changed to use pidofproc()
|
|
||||||
instead of the deprecated getpids(). Additionally, it now accepts
|
|
||||||
the -p argument to specify a pidfile.
|
|
||||||
* lfs/init.d/functions: Currently, statusproc() always returns
|
|
||||||
successfully, and the only way to know if the process is running
|
|
||||||
is to parse the output. This changes statusproc() to return the
|
|
||||||
status of pidofproc(), which will return unsuccessfully if the
|
|
||||||
requested process is not running.
|
|
||||||
* lfs/init.d/functions: Changed reloadproc() to use pidofproc() and
|
|
||||||
respect the -p argument for pidfiles.
|
|
||||||
* lfs/init.d/sysklogd: Remove a useless argument to reloadproc().
|
|
||||||
|
|
||||||
2007-03-13 Dan Nicholson <dnicholson@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/functions: If pidofproc() is passed the -p argument
|
|
||||||
it can bomb testing a null variable with an integer expression.
|
|
||||||
|
|
||||||
2007-02-22 Dan Nicholson <dnicholson@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/mountfs, lfs/init.d/console, lfs/init.d/setclock,
|
|
||||||
lfs/init.d/mountkernfs: &> redirection is not supported in POSIX.
|
|
||||||
Fortunately, it's equivalent to >word 2>&1 according to bash(1).
|
|
||||||
|
|
||||||
2007-02-22 Dan Nicholson <dnicholson@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/console: POSIX says that shells only need to trap on
|
|
||||||
signals. Trapping on ERR isn't always supported. Conditionals have
|
|
||||||
been added to set the $failed variable in spots that seemed
|
|
||||||
appropriate for checking errors.
|
|
||||||
|
|
||||||
2007-02-22 Dan Nicholson <dnicholson@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/functions: Use arithmetic expansion and string length,
|
|
||||||
which are both mandated by POSIX, rather than spawning two processes
|
|
||||||
every time boot_mesg() is called.
|
|
||||||
|
|
||||||
2007-02-22 Dan Nicholson <dnicholson@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/functions: In order to provide an `echo' which provides
|
|
||||||
handles the -e and -n options for all POSIX shells, a feature test
|
|
||||||
is added which stores its result in $ECHO. /bin/echo will be used
|
|
||||||
if the default echo is not capable. Changed the existing functions
|
|
||||||
to reference $ECHO when needed.
|
|
||||||
* lfs/init.d/console: Use $ECHO when -en is needed.
|
|
||||||
|
|
||||||
2007-02-03 Bryan Kadzban <bryan@linuxfromscratch.org>
|
|
||||||
* ChangeLog: Rename from CHANGELOG, start using GNU style entries.
|
|
||||||
|
|
||||||
* Makefile: Move setclock before checkfs. Fixes #1948.
|
|
||||||
|
|
||||||
2006-11-25 Bryan Kadzban <bryan@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/udev_retry: Copy Debian's "copy generated rules" initscript
|
|
||||||
code, to clean up when the rule_generator scripts run before / is
|
|
||||||
writable. (Since the rule_generator code is from Debian, I assume their
|
|
||||||
cleanup code is appropriate.)
|
|
||||||
|
|
||||||
2006-10-15 Bryan Kadzban <bryan@linuxfromscratch.org>
|
|
||||||
* lfs/init.d/udev_retry: Fix to work with udev >= 099.
|
|
||||||
|
|
||||||
n/a - June 2, 2006
|
|
||||||
* Removed console config file and makefile targets.
|
|
||||||
* Removed references to /dev/bug and bugreport in udevand
|
|
||||||
udev_retry bootscripts. (DJ Lucas)
|
|
||||||
|
|
||||||
n/a - April 17, 2006
|
|
||||||
* Updated udev script to use the new udevsettle program.
|
|
||||||
* Added udev_retry script for systems that have /usr on a different
|
|
||||||
partition or for some other reason fail the initial replay. (Archaic)
|
|
||||||
|
|
||||||
n/a - April 15, 2006
|
|
||||||
* Cleaned up contrib directory. Removed: contrib/init.d,
|
|
||||||
contrib/enhanced, contrib/livecd, contrib/hotplug, and raq2
|
|
||||||
patch. (DJ Lucas)
|
|
||||||
|
|
||||||
n/a - April 14, 2006
|
|
||||||
* Merged changes from udev_update branch (DJ Lucas)
|
|
||||||
* Replaced a return with an exit and reversed comment changes in
|
|
||||||
udev bootscript. (Dan Nicholson)
|
|
||||||
* Replaced walk_sysfs function in udev bootscript with new udevtrigger
|
|
||||||
program and move wait_for_uevents function inline. (DJ Lucas)
|
|
||||||
* Removed extra evaluate_retval in udev bootscript. (Ken Moffat)
|
|
||||||
* Wait for uevents to be processed in the udev script. See ticket
|
|
||||||
#1720 for details. (Matthew Burgess)
|
|
||||||
|
|
||||||
n/a - March 21, 2006
|
|
||||||
* Removed old references to boot_log function and arguments passed
|
|
||||||
to boot_mesg_flush in echo_* functions. (DJ Lucas)
|
|
||||||
|
|
||||||
n/a - March 10, 2006
|
|
||||||
* Moved src argument to ipv4-static-route service script and
|
|
||||||
removed from ipv4-static service script. (DJ Lucas)
|
|
||||||
|
|
||||||
n/a - March 8. 2006
|
|
||||||
* Correct sourced path in checkfs script. (Matthew Burgess)
|
|
||||||
|
|
||||||
n/a - December 31, 2005
|
|
||||||
* Replaced /etc/rc.d with ${rc_base} in checkfs. (Vincent Fretin)
|
|
||||||
|
|
||||||
n/a - December 24, 2005
|
|
||||||
* Added UTF-8 support to console script. (Alexander E. Patrakov)
|
|
||||||
|
|
||||||
n/a - September 11, 2005
|
|
||||||
* Removed text wraping and boot logging.
|
|
||||||
* Changed killproc to use warning if not running
|
|
||||||
* Changed 'print_status warning' to use old style output
|
|
||||||
* Fixed display error with LSB init-functions script
|
|
||||||
* Made above killproc/print_status changes in enhanced
|
|
||||||
bootscripts.
|
|
||||||
* Made logger service configurable in enhanced
|
|
||||||
bootscripts. (DJ Lucas)
|
|
||||||
|
|
||||||
n/a - August 14, 2005
|
|
||||||
* Added -s flag to pidofproc() for backwards
|
|
||||||
compatibility (DJ Lucas)
|
|
||||||
* Fixed erronous values returned by pidofproc() which
|
|
||||||
broke the functionality of statusproc (DJ Lucas)
|
|
||||||
|
|
||||||
n/a - July 1, 2005
|
|
||||||
* Changed a == to a = in lfs/init.d/functions, in the boot_mesg
|
|
||||||
function for ash compliancy (Nathan Coulson)
|
|
||||||
|
|
||||||
n/a - June 26, 2005
|
|
||||||
* Removed consolelog script from contrib
|
|
||||||
* Updated interactive rc script in contrib and added
|
|
||||||
README.rc-Interactive, added install target to the
|
|
||||||
Makefile. (DJ Lucas)
|
|
||||||
|
|
||||||
3.2.2 - May 29, 2005
|
|
||||||
* Tagged as 3.2.2 (Nathan Coulson)
|
|
||||||
|
|
||||||
n/a - May 26, 2005
|
|
||||||
* Added minimal target for cross-lfs book (Jim Gifford)
|
|
||||||
* Fixed raq2 patch (Jim Gifford)
|
|
||||||
|
|
||||||
3.2.1 - May 1, 2005
|
|
||||||
* Tagged as 3.2.1 (Nathan Coulson)
|
|
||||||
|
|
||||||
n/a - April 17, 2005
|
|
||||||
* removed touch from hotplug bootscript (Matthew Burgess)
|
|
||||||
* moved commands around in localnet bootscript (Andrew Benton)
|
|
||||||
|
|
||||||
3.2.0 - March 30, 2005
|
|
||||||
* Changed from syslog-ng to sysklogd (Archaic)
|
|
||||||
* Temporairly changed loadproc to return 0 if the program is
|
|
||||||
already running (Nathan Coulson)
|
|
||||||
* Fixed (by reverting) ifup/ifdown/network (Nathan Coulson),
|
|
||||||
Reported by Jim Gifford
|
|
||||||
* Fixed network up/down along with adding support of ONHOTPLUG
|
|
||||||
* Tagged as 3.2.0
|
|
||||||
|
|
||||||
n/a - March 19, 2005
|
|
||||||
* Updated RaQ2 patch (Jim Gifford)
|
|
||||||
* Added net.agent for Hotplug of Network adapters in contrib
|
|
||||||
(Jim Gifford)
|
|
||||||
|
|
||||||
n/a - March 16, 2005
|
|
||||||
* Reverted the change from loadproc to start_daemon,
|
|
||||||
Moved compatibility code into one single function.
|
|
||||||
(Nathan Coulson)
|
|
||||||
* Readded the ONHOTPLUG option for ifup/ifdown (Nathan Coulson)
|
|
||||||
* Fixed killproc's output
|
|
||||||
|
|
||||||
n/a - March 01, 2005
|
|
||||||
* Added CHECK_LINK variable in ifconfig.*/*, so if the
|
|
||||||
interface does not exist, it will not fail.
|
|
||||||
(Nathan Coulson)
|
|
||||||
|
|
||||||
n/a - February 19, 2005
|
|
||||||
* Added evaluate_retval to the end of loadproc and killproc.
|
|
||||||
lsb does not say that killproc should print [ OK ],
|
|
||||||
but required for compatibility. (Nathan Coulson)
|
|
||||||
|
|
||||||
n/a - February 9, 2005
|
|
||||||
* Accidently mounted /dev with 775 instead of 755, fixed
|
|
||||||
(Reported by Alexander E. Patrakov)
|
|
||||||
|
|
||||||
n/a - February 9, 2005
|
|
||||||
* Bugfix for /dev, now mounted with 755 permission
|
|
||||||
|
|
||||||
n/a - February 8, 2005
|
|
||||||
* changed pidof, so it doesnt check the process id
|
|
||||||
of running bootscripts, and to process shell scripts
|
|
||||||
(Nathan Coulson)
|
|
||||||
|
|
||||||
n/a - February 6, 2005
|
|
||||||
* Updated main functions file with lsb functions file
|
|
||||||
Should now be LSB compliant (Nathan Coulson)
|
|
||||||
|
|
||||||
n/a - January 10, 2005
|
|
||||||
* Moved ONBOOT check back to network (Nathan Coulson)
|
|
||||||
* Removed ONHOTPLUG check (Nathan Coulson)
|
|
||||||
|
|
||||||
n/a - January 6, 2005
|
|
||||||
* fixed mountkernfs output (Nathan Coulson)
|
|
||||||
* reverted mountfs fakemounting (Nathan Coulson)
|
|
||||||
|
|
||||||
n/a - January 5, 2005
|
|
||||||
* Attempted to simplify network bootup files (Nathan Coulson)
|
|
||||||
* Modified mountkernfs to use mountpoint (Nathan Coulson)
|
|
||||||
* Assuming sysfs is always mounted (Nathan Coulson)
|
|
||||||
* Moved fakemount to below mounting (Nathan Coulson)
|
|
||||||
* Removed -t noramfs from umount, as we now use tmpfs (Nathan Coulson)
|
|
||||||
* moved sysctl from mountkernfs to sysctl (Nathan Coulson)
|
|
||||||
* Added -q to sysctl (Nathan Coulson)
|
|
||||||
|
|
||||||
n/a - January 2, 2005
|
|
||||||
* Fixed statusproc output. (DJ Lucas)
|
|
||||||
|
|
||||||
3.1.0 - December 31, 2004
|
|
||||||
* fixed textoutput
|
|
||||||
* Tagged as 3.1.0
|
|
||||||
|
|
||||||
n/a - December 30, 2004
|
|
||||||
* Fixed name of LSB Functions file
|
|
||||||
* Changed boot_mesg to act like echo instead of echo -n, boot_mesg now
|
|
||||||
takes the -n argument if you do not wish to goto the next line
|
|
||||||
|
|
||||||
3.0.1 - December 25, 2004
|
|
||||||
* Released as 3.0.1
|
|
||||||
|
|
||||||
n/a - December 20, 2004
|
|
||||||
* Cleaned up header.
|
|
||||||
* Added RaQ2 Patch
|
|
||||||
|
|
||||||
n/a - December 16, 2004
|
|
||||||
* Fixed a text typo in udev, tmpfs instead of ramfs (Steve Crosby)
|
|
||||||
|
|
||||||
n/a - December 14, 2004
|
|
||||||
* Fixed a warning with find in cleanfs
|
|
||||||
|
|
||||||
|
|
||||||
3.0 - December 8, 2004
|
|
||||||
|
|
||||||
n/a - December 5, 2004
|
|
||||||
* Moved bootlog to use local2 service to avoide conflict with
|
|
||||||
dhcpcd (DJ Lucas)
|
|
||||||
|
|
||||||
3.0-rc1 - December 1, 2004
|
|
||||||
* rc-Interactive added (DJ Lucas)
|
|
||||||
* rc-Interactive moved to contrib (Nathan Coulson)
|
|
||||||
|
|
||||||
n/a - November 27, 2004
|
|
||||||
* Moved bootlog to use local1 to avoid conflict with ppd (DJ Lucas)
|
|
||||||
|
|
||||||
n/a - November 25, 2004
|
|
||||||
* Added consolelog to contrib/sysconfig (DJ Lucas)
|
|
||||||
* Rewrite of line wraping in boot_mesg and various fixes
|
|
||||||
related to boot_mesg changes (DJ Lucas, Alexander Patrakov)
|
|
||||||
* syslog-ng is now installed by default (Jeremy Utley)
|
|
||||||
* hotplug is now installed by default (Jeremy Utley)
|
|
||||||
* udev now uses /sbin/hotplug as the default hotplug handler
|
|
||||||
(Nathan Coulson)
|
|
||||||
* udev now mounts a tmpfs instead of a ramfs onto /dev,
|
|
||||||
as suggested by Greg K-H (Nathan Coulson)
|
|
||||||
* Created contrib/lsb, and added a LSB compliant functions file
|
|
||||||
(Nathan Coulson, and Alexander Patrakov)
|
|
||||||
* Modified find [requires find 4.2.3+] (Matthew Burgess)
|
|
||||||
|
|
||||||
n/a - November 20, 2004
|
|
||||||
* Modifed modules script to return to previous kernel message
|
|
||||||
level (DJ Lucas)
|
|
||||||
|
|
||||||
n/a - November 02, 2004
|
|
||||||
* Added sysctl -p to mountkernfs (Matthew Burgess, DJ Lucas)
|
|
||||||
|
|
||||||
n/a - October 07, 2004
|
|
||||||
* statusproc modified not to send data to bootlog (Nathan Coulson)
|
|
||||||
* Fixed halt commands in checkfs and udev (James Robertson)
|
|
||||||
|
|
||||||
n/a - October 04, 2004
|
|
||||||
* Fixes to commit on 2004/09/30 (James Robertson)
|
|
||||||
* Revert a few changes until later (Nathan Coulson)
|
|
||||||
* Added a warning about switching from a 8bit font
|
|
||||||
to a 9bit font (Alexander Patrakov)
|
|
||||||
|
|
||||||
n/a - September 30, 2004
|
|
||||||
* Finished off boot_mesg() (James Robertson)
|
|
||||||
* Standardized all scripts to same variable format and other
|
|
||||||
internal sh/bash function calls (James Robertson)
|
|
||||||
* Fully implemented boot_mesg across all scripts in sysconfig
|
|
||||||
and init.d (James Robertson)
|
|
||||||
|
|
||||||
n/a - September 26, 2004
|
|
||||||
* Added BOOTMESG_PREFIX variable, so users can optionally set a
|
|
||||||
prefix for boot messages (James Robertson)
|
|
||||||
* Fixed localnet status, to use ip instead of ifconfig (Jim Gifford)
|
|
||||||
* Added consolelog to contrib (DJ Lucas)
|
|
||||||
* loadproc and killproc can have the -nomsg parameter to avoid
|
|
||||||
calling evaluate_retval or print_status (Jim Gifford)
|
|
||||||
* boot_mesg no longer explicitly adds a \n onto end of lines
|
|
||||||
* Added a function called boot_mesg_flush, which can
|
|
||||||
dump the BOOTMESG to the bootlog. This helps avoid making
|
|
||||||
everything have to end in OK/WARN/FAIL (Nathan Coulson)
|
|
||||||
|
|
||||||
n/a - September 24, 2004
|
|
||||||
* Removed /dev/udev.tdb test
|
|
||||||
|
|
||||||
n/a - September 23, 2004
|
|
||||||
* Fixed boot_log so it output's $@'s contents, not @$
|
|
||||||
* Added support for colors in boot_mesg (James Robertson)
|
|
||||||
* Modified udev's error checking
|
|
||||||
* Modified hotplug's error checking
|
|
||||||
* Converted checkfs's error handling to use boot_mesg with
|
|
||||||
color support
|
|
||||||
* Added $INFO color to functions (James Robertson)
|
|
||||||
|
|
||||||
n/a - September 22, 2004
|
|
||||||
* Removed the dependency on wl by replacing it with grep (Bryan Kadzban)
|
|
||||||
* Fixed getpids, to remove unused pids obtained from $PIDFILE
|
|
||||||
* Removed ${NORMAL} from echo "$BOOTMESG" in functions, and removed
|
|
||||||
space added to each additional sentence tacked onto BOOTMESG
|
|
||||||
* boot_mesg now handles \n's properly, and does not dimish the size of
|
|
||||||
the next line (James Robertson)
|
|
||||||
* boot_log has been added. The echo_ functions commit the log,
|
|
||||||
and then clear the BOOTMSG variable
|
|
||||||
* All scriptes have been converted to use boot_mesg
|
|
||||||
|
|
||||||
n/a - September 21, 2004
|
|
||||||
* boot_mesg has been enhanced. Subsequent calls will overwrite
|
|
||||||
previous text, and it will wrap text basedupon the variable ${WCOL}.
|
|
||||||
(James Robertson)
|
|
||||||
* Fixed mtu optional service typo (Kevin P Fleming)
|
|
||||||
* Added SOURCE variable to ipv4-static-route (Kevin P Fleming)
|
|
||||||
|
|
||||||
n/a - September 16, 2004
|
|
||||||
* nework interfaces are now brought down in reverse order
|
|
||||||
|
|
||||||
n/a - September 15, 2004
|
|
||||||
* Added blue bracket, from dj's 3.0-pre1 bootscript package
|
|
||||||
[echo_failure, echo_warning, and echo_ok]
|
|
||||||
* Added a new function called boot_mesg, meant to replace the echo
|
|
||||||
command.
|
|
||||||
This will give us the posibility of doing logging at a later date
|
|
||||||
* Do not set COLUMNS if COLUMNS is already set
|
|
||||||
* Modified getpids, loadproc, killproc, reloadproc, and statusproc as
|
|
||||||
done by DJ
|
|
||||||
|
|
||||||
2.2.3 - September 04, 2004
|
|
||||||
* Tagged as 2.2.3
|
|
||||||
|
|
||||||
n/a - September 04, 2004
|
|
||||||
* Added new script to contrib for syslog-ng, which is now part of
|
|
||||||
LFS-Unstable, and a new Makefile target install-syslog-ng which
|
|
||||||
removes the sysklogd links, and replaces them with syslog-ng (JU)
|
|
||||||
|
|
||||||
2.2.2 - August 11, 2004
|
|
||||||
* Tagged as 2.2.2
|
|
||||||
|
|
||||||
n/a - August 7, 2004
|
|
||||||
* Added missing error redirect (/dev/null) in getpids. (DJ)
|
|
||||||
|
|
||||||
n/a - August 4, 2004
|
|
||||||
* Added MODE, DIRMODE, and CONFMODE variables to the makefile
|
|
||||||
to allow permissions to be set at install. (DJ)
|
|
||||||
|
|
||||||
n/a - July 31, 2004
|
|
||||||
|
|
||||||
* Moved PIDFILE check to getpids and removed arguments from
|
|
||||||
killproc and reloadproc. Signals are now set at begining of
|
|
||||||
funtcions script with KILLDELAY. (DJ)
|
|
||||||
* Added a optional service script which can set the MTU for a given
|
|
||||||
interface
|
|
||||||
|
|
||||||
n/a - July 21, 2004
|
|
||||||
|
|
||||||
* Committed DJ Lucas's patch for the killproc function. It no
|
|
||||||
longer requires arguments if PIDFILE is set
|
|
||||||
* added --backup to all sysconfig configuration files, so they are not
|
|
||||||
replaced on a make install
|
|
||||||
|
|
||||||
n/a - July 13, 2004
|
|
||||||
|
|
||||||
* Added the PEER variable to the ifconfig.*/* file, done by
|
|
||||||
Kevin P. Fleming
|
|
||||||
|
|
||||||
2.2.1 - July 12, 2004
|
|
||||||
|
|
||||||
* Tagged as 2.2.1
|
|
||||||
|
|
||||||
n/a - July 12, 2004
|
|
||||||
|
|
||||||
* Hotplug was moved from rcsysinit.d to rc{1,2,3,4,5} to help bring
|
|
||||||
up/down network interfaces started by hotplug. This has been revoked
|
|
||||||
at this time
|
|
||||||
* Networking interfaces are now brought down in reverse order
|
|
||||||
* Moved the ONBOOT check to within ifup/ifdown, so we can bring up/down
|
|
||||||
the interfaces at boottime/shutdown properly, done by Kevin P. Fleming
|
|
||||||
* Use PREFIX instead of NETMASK for adding addresses in ipv4-static,
|
|
||||||
done by Kevin P. Fleming
|
|
||||||
* Fix reversal of services inside ifconfig.* directories in ifdown,
|
|
||||||
done by Kevin P. Fleming
|
|
||||||
* Add ipv4-static-route service, supplied by Kevin P. Fleming
|
|
||||||
|
|
||||||
2.2.0 - July 12, 2004
|
|
||||||
|
|
||||||
* Tagged as 2.2.0
|
|
||||||
|
|
||||||
n/a - July 11, 2004
|
|
||||||
|
|
||||||
* Minor script output changes
|
|
||||||
* Repaired networking scripts broken in previous commits
|
|
||||||
|
|
||||||
n/a - July 10, 2004
|
|
||||||
|
|
||||||
* We now use the ip program [from iproute2] instead of ipconfig
|
|
||||||
[net-tools] to bring up/down ethernet interfaces, and local
|
|
||||||
connections, submitted by Jim Gifford
|
|
||||||
* Removed gateway backward compatibility
|
|
||||||
* Removed ifup-eth0 ifdown-eth0 compatibility
|
|
||||||
* Removed the "assume SERVICE=static if SERVICE is unset" compatibility
|
|
||||||
* Pass the IFCONFIG environmental variable to services, so they can
|
|
||||||
locate the file with the parameters they must read
|
|
||||||
* Rename static to ipv4-static
|
|
||||||
* Stage1 for network configuration via directories, ifup and ifdown
|
|
||||||
modified, and the static service modified
|
|
||||||
* Stage2 for network configuration via directories complete, network was
|
|
||||||
modified to check within subdirectories for ONBOOT=yes. Final Stage
|
|
||||||
|
|
||||||
n/a - July 8, 2004
|
|
||||||
|
|
||||||
* Changed iso01 to lat1 everywhere in /etc/sysconfig/console. This
|
|
||||||
fixes the problem with line-drawing characters.
|
|
||||||
|
|
||||||
n/a - July 7, 2004
|
|
||||||
|
|
||||||
* Halted the computer, if unable to mount /dev as a ramfs
|
|
||||||
|
|
||||||
n/a - July 6, 2004
|
|
||||||
|
|
||||||
* Moved the hotplug bootscript back to contrib, it will not be used in
|
|
||||||
the testing branch of the lfs book at this time
|
|
||||||
|
|
||||||
n/a - July 4, 2004
|
|
||||||
|
|
||||||
* Modified ifup and ifdown to be hotplug aware
|
|
||||||
|
|
||||||
n/a - July 3, 2004
|
|
||||||
|
|
||||||
* Change the check for ONBOOT into a source within a subshell
|
|
||||||
|
|
||||||
n/a - July 1, 2004
|
|
||||||
|
|
||||||
* Moved hotplug start to runlevels 3-5 from sysinit
|
|
||||||
|
|
||||||
n/a - June 30, 2004
|
|
||||||
|
|
||||||
* Pass -depth in cleanfs
|
|
||||||
|
|
||||||
n/a - June 29, 2004
|
|
||||||
|
|
||||||
* Made the grep for ONBOOT in the network script more exact
|
|
||||||
|
|
||||||
2.1.2 - June 27, 2004
|
|
||||||
|
|
||||||
* Install the automatic module loading script by default
|
|
||||||
* Tagged as 2.1.2
|
|
||||||
|
|
||||||
n/a - June 26, 2004
|
|
||||||
|
|
||||||
* Fixed font for UK in /etc/sysconfig/console
|
|
||||||
|
|
||||||
n/a - June 23, 2004
|
|
||||||
|
|
||||||
* Fixed a typo in the hotplug installation procedure
|
|
||||||
|
|
||||||
n/a - June 21, 2004
|
|
||||||
|
|
||||||
* Re-ordered the "mount" and "echo" commands in the udev script, to
|
|
||||||
prevent a possible race
|
|
||||||
* Converted the udev script to use udevsend/udevd
|
|
||||||
* Moved removal of /fastboot and /forcefsck to just after the root fs
|
|
||||||
becomes writable, and dropped the removal of /etc/nologin
|
|
||||||
* Cleaned and tweaked both the output and actions of cleanfs
|
|
||||||
* Removed the disabling of hotplug from sendsignals
|
|
||||||
* Removed anything that might call "rmmod" in hotplug, since rmmod is
|
|
||||||
notoriously troublesome in the 2.6.x kernels, and call it with the
|
|
||||||
stop argument from runlevels 0 and 6
|
|
||||||
* Fixed previous modifications to the udev and cleanfs scripts
|
|
||||||
|
|
||||||
n/a - June 20, 2004
|
|
||||||
|
|
||||||
* Rolled back to the /dev/.udev.tdb check from 2.1.1, since the new
|
|
||||||
one doesn't work as well, and the bug that caused it to change is
|
|
||||||
now fixed
|
|
||||||
|
|
||||||
n/a - June 18, 2004
|
|
||||||
|
|
||||||
* Updated sysconfig/console
|
|
||||||
* Fixed disabling hotplug in sendsignals
|
|
||||||
* hotplug is now installed by default
|
|
||||||
|
|
||||||
n/a - June 15, 2004
|
|
||||||
|
|
||||||
* Reset /proc/sys/kernel/hotplug to /bin/true when running the "stop"
|
|
||||||
command for hotplug
|
|
||||||
* Cleaned the output of the mountkernfs script
|
|
||||||
* Don't output "Creating files and directories" when it's a lie
|
|
||||||
|
|
||||||
n/a - June 8, 2004
|
|
||||||
|
|
||||||
* Changed the location the optional module script is installed to
|
|
||||||
/etc/rc.d/rcsysinit.d/S05modules.
|
|
||||||
|
|
||||||
n/a - June 4, 2004
|
|
||||||
|
|
||||||
* Added a echo to the > /proc/sys/kernel/hotplug line, as > did not
|
|
||||||
clear it
|
|
||||||
|
|
||||||
n/a - June 3, 2004
|
|
||||||
|
|
||||||
* Added '> /proc/sys/kernel/hotplug' to sendsignals, to disable hotplug
|
|
||||||
events, which may start up new daemons
|
|
||||||
* Added elementry bootup logging support. If it can write to
|
|
||||||
/var/log/boot.log, it will
|
|
||||||
* Removed logging support, it kept / from being remounted ro
|
|
||||||
|
|
||||||
n/a - June 2, 2004
|
|
||||||
|
|
||||||
* Reorganize what goes on in the udev script
|
|
||||||
* Reorganize what goes on in the hotplug script
|
|
||||||
* Moved setting /sbin/hotplug as the default hotplug manager into the
|
|
||||||
hotplug script
|
|
||||||
|
|
||||||
n/a - June 1, 2004
|
|
||||||
|
|
||||||
* Removed usbfs from mountkernfs, and mountfs
|
|
||||||
* Edited the udev script, so it'll always set /proc/sys/kernel/hotplug
|
|
||||||
|
|
||||||
n/a - May 24, 2004
|
|
||||||
|
|
||||||
* Added more example keymaps and font settings to /etc/sysconfig/console
|
|
||||||
* Install the /etc/sysconfig/console file by default
|
|
||||||
|
|
||||||
n/a - May 23, 2004
|
|
||||||
|
|
||||||
* Changed the symlink for the optional modules script
|
|
||||||
* Removed depmod from the optional modules script
|
|
||||||
|
|
||||||
n/a - May 20, 2004
|
|
||||||
|
|
||||||
* Removed the random script. There is not a strong enough case for
|
|
||||||
adding it to the lfs-bootscripts.
|
|
||||||
|
|
||||||
n/a - May 19, 2004
|
|
||||||
|
|
||||||
* Added the random bootscript from blfs-bootscripts
|
|
||||||
|
|
||||||
2.1.1 - May 18, 2004
|
|
||||||
|
|
||||||
* Fixed installation of modules configuration
|
|
||||||
* Tagged as 2.1.1
|
|
||||||
|
|
||||||
n/a - May 16, 2004
|
|
||||||
|
|
||||||
* Added sysklogd configuration file
|
|
||||||
* Added example /etc/sysconfig/console file
|
|
||||||
* Do not attempt to populate /dev if that directory has already been
|
|
||||||
set up earlier in bootup (such as on initramfs/initrd)
|
|
||||||
* Prevent excessive kernel output once klogd starts
|
|
||||||
* Added hotplug script
|
|
||||||
|
|
||||||
n/a - May 15, 2004
|
|
||||||
|
|
||||||
* Namespace rework (enumeration of scripts is now cleaner)
|
|
||||||
* Removed directories: blfs, contrib/new-boot-0.2, contrib/rlv
|
|
||||||
|
|
||||||
n/a - May 13, 2004
|
|
||||||
|
|
||||||
* Repaired the console script
|
|
||||||
* Added a check to cleanfs [createfiles], to make sure that we have
|
|
||||||
a valid devicetype, if we have type=dev
|
|
||||||
|
|
||||||
n/a - May 11, 2004
|
|
||||||
|
|
||||||
* Added usbfs to mountkernfs and mountfs
|
|
||||||
|
|
||||||
n/a - May 6, 2004
|
|
||||||
|
|
||||||
* Don't use loadproc in localnet, it's not meant for that
|
|
||||||
* Quote tests of $PIDFILE, so that things behave when it's empty
|
|
||||||
* Removed unused kill -0 from killproc
|
|
||||||
|
|
||||||
2.1.0 - May 4, 2004
|
|
||||||
|
|
||||||
* Update to the console script, prevent install of the console script
|
|
||||||
* Chgrp /var/run/utmp to group utmp if it exists.
|
|
||||||
* Moved udev from contrib to lfs
|
|
||||||
* Moved GATEWAY setup from /etc/rc.d/init.d/network to
|
|
||||||
/etc/sysconfig/network-devices/services/static
|
|
||||||
* Use the contents of $PIDFILE, if it is set in the script
|
|
||||||
* Tagged as 2.1.0.
|
|
||||||
|
|
||||||
n/a - April 30, 2004
|
|
||||||
|
|
||||||
* Moved the loadkeys script to console, and added setfont. Contributed
|
|
||||||
by Alexander E. Patrakov
|
|
||||||
|
|
||||||
2.0.5 - April 29, 2004
|
|
||||||
|
|
||||||
* Added the heimdal init script.
|
|
||||||
* Tagged as 2.0.5
|
|
||||||
|
|
||||||
2.0.4 - April 27, 2004
|
|
||||||
|
|
||||||
* Tagged as 2.0.4
|
|
||||||
|
|
||||||
n/a - April 24, 2004
|
|
||||||
|
|
||||||
* Added a example script for /etc/sysconfig/createfiles
|
|
||||||
* Added a check for /sys before mounting sysfs
|
|
||||||
* Added -t noramfs to umount on /etc/rc.d/init.d/mountfs.
|
|
||||||
This will prevent /dev from being unmounted, if /proc/mounts
|
|
||||||
is symlinked to /etc/mtab
|
|
||||||
|
|
||||||
n/a - April 18, 2004
|
|
||||||
|
|
||||||
* Small fix to a if statement in netfs
|
|
||||||
|
|
||||||
n/a - April 17, 2004
|
|
||||||
|
|
||||||
* Added the lisa bootscript, lisa is part of the KDE Network package
|
|
||||||
* Add proper error checking to the mountfs script when writing out mtab
|
|
||||||
* Add more comments to the udev script, and conditionalize various
|
|
||||||
things that should've been done this way in the first place
|
|
||||||
* Include a template module auto-loading configuration file instead of
|
|
||||||
having syntax comments in the script itself
|
|
||||||
|
|
||||||
n/a - April 12, 2004
|
|
||||||
|
|
||||||
* Added a automatic modules loading script to the contrib directory
|
|
||||||
submitted by Zack
|
|
||||||
* Edited mountkernfs, so that if you can mount sysfs on /sys, it will
|
|
||||||
be mounted at boottime. Should not affect 2.4 systems
|
|
||||||
* Since all entries are added to /etc/mtab, we should not require
|
|
||||||
the NO_FS variable. It has been removed from mountfs
|
|
||||||
* Added the udev script into the contrib directory, submitted by Zack
|
|
||||||
|
|
||||||
2.0.3 - April 8, 2004
|
|
||||||
|
|
||||||
* Updated cleanfs, so it can create devices. Supplied by Zack
|
|
||||||
* Tagged as 2.0.3
|
|
||||||
|
|
||||||
n/a - March 31, 2004
|
|
||||||
|
|
||||||
* Changed "Press Enter" on unknown error to white
|
|
||||||
* Moved S10swap to S20swap. When udev is added, it has to be
|
|
||||||
ran before swap is setup
|
|
||||||
|
|
||||||
n/a - March 29, 2004
|
|
||||||
|
|
||||||
* Fixed the rc5.d symlink for ntp so it creates S26ntp instead
|
|
||||||
of S26npt
|
|
||||||
* Moved S20mountkernfs to S00mountkernfs in rcsysinit.d. Will help in
|
|
||||||
the addition of udev in the future.
|
|
||||||
|
|
||||||
n/a - March 27, 2004
|
|
||||||
|
|
||||||
* Changed gdm path from hardcoded to program name. There are 2 spots
|
|
||||||
gnome can be installed
|
|
||||||
|
|
||||||
n/a - March 26, 2004
|
|
||||||
|
|
||||||
* Updated fam daemon script. It now uses the famd daemon instead of fam
|
|
||||||
|
|
||||||
n/a - March 24, 2004
|
|
||||||
|
|
||||||
* Removed mount command out of nfs. the netfs script already handles
|
|
||||||
this
|
|
||||||
|
|
||||||
2.0.2 - March 24, 2004
|
|
||||||
|
|
||||||
* Edited cleanfs to solve a problem. [if /tmp does not exist, it
|
|
||||||
could run the find command on the root filesystem]
|
|
||||||
* Tagged as 2.0.2
|
|
||||||
|
|
||||||
2.0.1 - March 24, 2004
|
|
||||||
|
|
||||||
* Found typo in BLFS MySQL Script.
|
|
||||||
* Tagged as 2.0.1
|
|
||||||
|
|
||||||
2.0.0 - March 23, 2004
|
|
||||||
|
|
||||||
* Tagged as 2.0.0, no changes from 2.0.0-pre2
|
|
||||||
|
|
||||||
2.0.0-pre2 - March 23, 2004
|
|
||||||
|
|
||||||
* Cleaned the /tmp directory on bootup. find command supplied by Zack
|
|
||||||
* Added a script which can automatically create files and directories
|
|
||||||
on startup. [Handles files/directories, permissions, and user/group].
|
|
||||||
Created by Zack
|
|
||||||
* Added blfs/init.d/fam script
|
|
||||||
* Tagged as 2.0.0-pre2
|
|
||||||
|
|
||||||
n/a - March 20, 2004
|
|
||||||
|
|
||||||
* Added create-service-dir target and removed from create-dirs
|
|
||||||
* Changed service script install targets to use
|
|
||||||
create-service-dir
|
|
||||||
* Added check for dhcpcd service script for stale pid file
|
|
||||||
Suggested by Jeremy
|
|
||||||
* Added ifconfig to ipx service script for hosting device not up
|
|
||||||
|
|
||||||
n/a - March 19, 2004
|
|
||||||
|
|
||||||
* Added support for ETCDIR, and DESTDIR in the Makefile,
|
|
||||||
compliments of Tushar
|
|
||||||
* Renamed mountproc to mountkernfs
|
|
||||||
* Updated the README file
|
|
||||||
* Coloured the print_error_message in functions red
|
|
||||||
* added stop to the setclock script
|
|
||||||
* changed echo > to > in cleanfs, suggested by winkie
|
|
||||||
* BLFS Scripts Added, collected by Zack
|
|
||||||
* Edited killproc, so it checks for running pids, rather then
|
|
||||||
the completion of the above kill command. Suggested by Zack
|
|
||||||
* Added network services found in blfs, removed adsl. Submitted by
|
|
||||||
DJ.
|
|
||||||
|
|
||||||
1.99.4 - March 17, 2004
|
|
||||||
|
|
||||||
* Fixed one last halt line in checkfs script
|
|
||||||
* Moved the directory structure around
|
|
||||||
* Tagged as development release 1.99.4
|
|
||||||
|
|
||||||
n/a - February 28, 2004
|
|
||||||
|
|
||||||
* Added stty sane to the top of rc.d/init.d/rc. Hopefully, this will
|
|
||||||
fix the problems
|
|
||||||
* Also changed all instances of <ctrl-j> back to enter
|
|
||||||
|
|
||||||
1.99.3 - February 23, 2004
|
|
||||||
|
|
||||||
* Tagged as development release 1.99.3
|
|
||||||
|
|
||||||
n/a - February 19, 2004
|
|
||||||
|
|
||||||
* Fixed checkfs script, so it will no longer continue to boot after a
|
|
||||||
failure in the init.d/checkfs script. Tested with the help of Andre
|
|
||||||
Müller. Fix suggested by Zack
|
|
||||||
|
|
||||||
n/a - February 7, 2004
|
|
||||||
|
|
||||||
* Added -s onto grep on network stop
|
|
||||||
* Replaced a few more enter's with ctrl-j
|
|
||||||
|
|
||||||
1.99.2 - February 6, 2004
|
|
||||||
|
|
||||||
* Added -s onto grep in network start
|
|
||||||
* Tagged as development release 1.99.2
|
|
||||||
|
|
||||||
n/a - February 4, 2004
|
|
||||||
|
|
||||||
* Fixed $WARNING $NORMAL and $ERROR lines, broken by changes in
|
|
||||||
functions
|
|
||||||
* Changed above fixes to work with ash
|
|
||||||
* Fixed checkfs symlink in Makefile
|
|
||||||
* functions is no longer installed as executable
|
|
||||||
* Added a check to checkfs, for errors above 16. These are caused by
|
|
||||||
being unable to run fsck, either due to user input, or a unfunctional
|
|
||||||
linux system
|
|
||||||
|
|
||||||
1.99.1 - February 2, 2004
|
|
||||||
|
|
||||||
* Tagged as development release 1.99.1
|
|
||||||
|
|
||||||
n/a - February 2, 2004:
|
|
||||||
|
|
||||||
* Added -d to umount in mountfs.
|
|
||||||
* Fixed network shutdown script
|
|
||||||
* Fixed Makefile rc.6 to reboot
|
|
||||||
* Added -s flag to grep command in rc.d/init.d/network -
|
|
||||||
suppresses an error if no ifconfig.* files exist
|
|
||||||
|
|
||||||
n/a - January 30, 2004:
|
|
||||||
|
|
||||||
* Reorganized the network system to accept multiple services.
|
|
||||||
* Ash Compliancy
|
|
||||||
* Modified some scripts to follow template
|
|
||||||
* Reorganized functions, based upon Ash Compliancy Patch
|
|
||||||
* Added a sleep 5 to failure for evaulate_retval, and changed
|
|
||||||
evaulate_retval to return true instead of false. Instead, a
|
|
||||||
exit 1 will indicate the script terminated abnormally, causing
|
|
||||||
your system to wait until you hit ctrl-J
|
|
||||||
* Switched "Press enter to continue" to "Press <ctrl-j> to continue"
|
|
||||||
* replaced 3 with $KILLDELAY in sendsignals
|
|
||||||
* mountfs does not mount network filesystems [identified by _netdev
|
|
||||||
in /etc/fstab]
|
|
||||||
* removed unneded touch out of cleanfs
|
|
||||||
|
|
||||||
n/a - January 30, 2004:
|
|
||||||
|
|
||||||
* New maintainers for the lfs-bootscripts package are:
|
|
||||||
Jeremy Utley (jeremy@linuxfromscratch.org)
|
|
||||||
Nathan Coulson (nathan@linuxfromscratch.org)
|
|
||||||
|
|
||||||
1.11 - February 3rd, 2003:
|
|
||||||
|
|
||||||
* /etc/mtab is now a real file and is handled correctly so there are
|
|
||||||
no errors even when the machine has crashed.
|
|
||||||
|
|
||||||
1.10 - September 12th, 2002:
|
|
||||||
|
|
||||||
* Fixed up checkfs to work with non-ext2 filesystems too (such as
|
|
||||||
minix).
|
|
||||||
|
|
||||||
1.9 - April 5th, 2002:
|
|
||||||
|
|
||||||
* reloadproc function had a missing '=' in the "failure 1" command (it
|
|
||||||
should be failure=1)
|
|
||||||
|
|
||||||
* When script exists with unexpected value, you have to hit "Enter" to
|
|
||||||
continue, not just a random key as printed on the screen.
|
|
||||||
|
|
||||||
* Moved K10sysklogd, K20sendsignals, K30mount and K40swap to
|
|
||||||
K40sysklogd, K50sendsignals, K60mount, K70swap
|
|
||||||
|
|
||||||
* Changed the #!/bin/sh lines to #!/bin/bash - /bin/sh may not be
|
|
||||||
linked to bash but to some other shell of your choice. These scripts
|
|
||||||
are written to work with bash, so you can't just run them when
|
|
||||||
/bin/sh -> csh or ash or whatever else tickles your fancy. This
|
|
||||||
change should fix that.
|
|
||||||
|
|
||||||
1.8 - March 14th, 2002:
|
|
||||||
|
|
||||||
* Fixed the getpids function call so PPID's would be taken into account
|
|
||||||
properly.
|
|
||||||
|
|
||||||
* Added the 'contrib' directory with other people's bootscript
|
|
||||||
implementations.
|
|
||||||
|
|
||||||
1.7 - March 10th, 2002:
|
|
||||||
|
|
||||||
* Used code from Matthias Benkmann's simpleinit-msb @
|
|
||||||
http://winterdrache.de/linux/newboot/index.html mainly for improved
|
|
||||||
killproc function handling
|
|
||||||
|
|
||||||
* When a requested process isn't running, or is already running, a
|
|
||||||
warning "Not running" or "Already running" will be displayed. This
|
|
||||||
was out of allignment due to a missing $CURS_UP
|
|
||||||
|
|
||||||
* Removed "||exit" from ifup and ifdown scripts. They are useless.
|
|
||||||
|
|
||||||
* Changed the loadkeys script to run "loadkeys -d" and removed the need
|
|
||||||
for the /etc/sysconfig/keyboard file. The kbd patch fixes the
|
|
||||||
"loadkeys -d" behaviour.
|
|
||||||
|
|
||||||
1.6 - February 26th, 2002:
|
|
||||||
|
|
||||||
* replaced -o %PPID with -o $PPID throughout the functions script. This
|
|
||||||
construct does what it's supposed to do (don't take PPID into account
|
|
||||||
because this would fail if a running daemon and the bootscript have
|
|
||||||
the same name).
|
|
||||||
|
|
||||||
* added 'restart' to the swap script
|
|
||||||
|
|
||||||
* instead of using 'echo -n' to supress newlines so the [ OK ] and
|
|
||||||
related messages allign properly, substitute this with a single echo
|
|
||||||
command that simply goes one line up before outputting anything. This
|
|
||||||
also has the benefit that when programs have their own output (like
|
|
||||||
swapon, fsck and loadkeys), there won't be an unwanted blank line
|
|
||||||
between the program's output and the [ OK ] et all. messages.
|
|
||||||
|
|
||||||
1.5 - February 2nd, 2002:
|
|
||||||
|
|
||||||
* added 'exit 1' to the statusproc function when there aren't enough
|
|
||||||
parameters passed to it (such as the name of process to check for)
|
|
||||||
|
|
||||||
1.4 - February 2nd, 2002:
|
|
||||||
|
|
||||||
* when /fastboot is detected and the message about it is printed,
|
|
||||||
don't run 'exit 1' else the rc script will cause a [FAILED] to
|
|
||||||
be printed which is undesired in this case.
|
|
||||||
|
|
||||||
1.3 - January 30th, 2002:
|
|
||||||
* network script: changed default route detection by using the same
|
|
||||||
method as used when starting the script: check if the GATEWAY
|
|
||||||
variable is set
|
|
||||||
|
|
||||||
* removed the emptying of /etc/mtab since it's a symlink to
|
|
||||||
/proc/mounts now
|
|
||||||
|
|
||||||
* added the mountproc script which mounts the proc system. This is done
|
|
||||||
because we need proc mounted even before the mountfs script is ran
|
|
||||||
(now that /etc/mtab is a symlink to /proc/mounts)
|
|
||||||
|
|
||||||
* removed all absolute paths from command calls
|
|
||||||
|
|
||||||
* added umask 022 and PATH="/bin:/usr/bin:/sbin:/usr/sbin" to the
|
|
||||||
functions script. Every file now sources this so that umask and PATH
|
|
||||||
are set correctly
|
|
||||||
|
|
||||||
1.2 - January 26th, 2002:
|
|
||||||
* network script: detect if a default route is set before removing it
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
|||||||
LSB-V3 Installation:
|
|
||||||
|
|
||||||
NOTE: initd-tools must be installed prior to installation of these scripts.
|
|
||||||
|
|
||||||
initd-tools installation:
|
|
||||||
|
|
||||||
Download initd-tools from:
|
|
||||||
http://www.dwcab.com/downloads/initd-tools/initd-tools-0.1.3.tar.gz
|
|
||||||
|
|
||||||
./configure &&
|
|
||||||
make &&
|
|
||||||
make check &&
|
|
||||||
make install
|
|
||||||
|
|
||||||
Inline installation of lsb-v3 bootscripts:
|
|
||||||
sudo make install
|
|
||||||
|
|
||||||
After LFS installation of lsb-v3 bootscripts:
|
|
||||||
for file in /etc/rc.d /etc/sysconfig/rc /etc/sysconfig/modules \
|
|
||||||
/etc/sysconfig/createfiles
|
|
||||||
do
|
|
||||||
mv $file $file.bak
|
|
||||||
done &&
|
|
||||||
make install
|
|
||||||
|
|
||||||
There is no longer an upgrade path for existing installations. You will have
|
|
||||||
to reinstall any bootscripts installed by BLFS or any self written scripts.
|
|
||||||
Fortunately, this will soon be very easy for BLFS scripts as a contrib
|
|
||||||
directory containing lsb-v3 scripts will be added in the near future.
|
|
||||||
|
|
||||||
That's it!
|
|
@ -1,20 +0,0 @@
|
|||||||
Copyright © 1999-2011 Gerard Beekmans
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
this software and associated documentation files (the "Software"), to deal in
|
|
||||||
the Software without restriction, including without limitation the rights to
|
|
||||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
||||||
of the Software, and to permit persons to whom the Software is furnished to do
|
|
||||||
so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
@ -1,101 +0,0 @@
|
|||||||
ETCDIR=/etc/rc.d
|
|
||||||
EXTDIR=${DESTDIR}${ETCDIR}
|
|
||||||
MODE=754
|
|
||||||
DIRMODE=755
|
|
||||||
CONFMODE=644
|
|
||||||
|
|
||||||
all: install
|
|
||||||
|
|
||||||
create-dirs:
|
|
||||||
if test ! -d /${DESTDIR}; then install -d -m ${DIRMODE} ${EXTDIR}; fi
|
|
||||||
install -d -m ${DIRMODE} ${EXTDIR}/rc0.d
|
|
||||||
install -d -m ${DIRMODE} ${EXTDIR}/rc1.d
|
|
||||||
install -d -m ${DIRMODE} ${EXTDIR}/rc2.d
|
|
||||||
install -d -m ${DIRMODE} ${EXTDIR}/rc3.d
|
|
||||||
install -d -m ${DIRMODE} ${EXTDIR}/rc4.d
|
|
||||||
install -d -m ${DIRMODE} ${EXTDIR}/rc5.d
|
|
||||||
install -d -m ${DIRMODE} ${EXTDIR}/rc6.d
|
|
||||||
install -d -m ${DIRMODE} ${EXTDIR}/rcS.d
|
|
||||||
install -d -m ${DIRMODE} ${EXTDIR}/init.d
|
|
||||||
install -d -m ${DIRMODE} ${DESTDIR}/etc/default
|
|
||||||
install -d -m ${DIRMODE} ${DESTDIR}/etc/network
|
|
||||||
install -d -m ${DIRMODE} ${DESTDIR}/sbin
|
|
||||||
install -d -m ${DIRMODE} ${DESTDIR}/lib/lsb
|
|
||||||
install -d -m ${DIRMODE} ${DESTDIR}/lib/network-services
|
|
||||||
if [ ${ETCDIR} != /etc ]; then ln -s ${ETCDIR}/init.d ${DESTDIR}/etc/init.d; fi
|
|
||||||
|
|
||||||
install: create-dirs
|
|
||||||
install -m ${MODE} etc/init.d/checkfs ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/cleanfs ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/halt ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/console ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/localnet ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/modules ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/mountfs ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/mountvirtfs ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/network ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/rc ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/reboot ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/sendsignals ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/setclock ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/sysklogd ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/swap ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/sysctl ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/template ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/udev ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/udev_retry ${EXTDIR}/init.d/
|
|
||||||
install -m ${CONFMODE} lib/lsb/init-functions ${DESTDIR}/lib/lsb/
|
|
||||||
if [ ! -f ${DESTDIR}/etc/default/createfiles ]; then install -m ${CONFMODE} etc/default/createfiles ${DESTDIR}/etc/default/; fi
|
|
||||||
if [ ! -f ${DESTDIR}/etc/default/modules ]; then install -m ${CONFMODE} etc/default/modules ${DESTDIR}/etc/default/; fi
|
|
||||||
if [ ! -f ${DESTDIR}/etc/default/rc ]; then install -m ${CONFMODE} etc/default/rc ${DESTDIR}/etc/default/; fi
|
|
||||||
if [ ! -f ${DESTDIR}/etc/default/rc.site ]; then install -m ${CONFMODE} etc/default/rc.site ${DESTDIR}/etc/default/; fi
|
|
||||||
install -m ${MODE} sbin/ifup ${DESTDIR}/sbin/
|
|
||||||
install -m ${MODE} sbin/ifdown ${DESTDIR}/sbin/
|
|
||||||
install -m ${MODE} lib/network-services/ipv4-static ${DESTDIR}/lib/network-services/
|
|
||||||
install -m ${MODE} lib/network-services/ipv4-static-route ${DESTDIR}/lib/network-services/
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/checkfs
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/cleanfs
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/halt
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/console
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/localnet
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/modules
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/mountfs
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/mountvirtfs
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/network
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/reboot
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/sendsignals
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/sysklogd
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/swap
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/sysctl
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/udev
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/udev_retry
|
|
||||||
sed 's@ETCDIR@${ETCDIR}@' -i ${DESTDIR}/etc/default/rc
|
|
||||||
|
|
||||||
minimal: create-dirs
|
|
||||||
install -m ${MODE} etc/init.d/checkfs ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/cleanfs ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/halt ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/localnet ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/mountfs ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/mountvirtfs ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/rc ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/reboot ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/sendsignals ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/detclock ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/swap ${EXTDIR}/init.d/
|
|
||||||
install -m ${MODE} etc/init.d/udev ${EXTDIR}/init.d/
|
|
||||||
install -m ${CONFMODE} lib/lsb/init-functions ${DESTDIR}/lib/lsb/
|
|
||||||
if [ ! -f ${DESTDIR}/etc/default/rc ]; then install -m ${CONFMODE} default/rc ${DESTDIR}/etc/default/; fi
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/checkfs
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/cleanfs
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/halt
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/localnet
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/mountfs
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/mountvirtfs
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/reboot
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/sendsignals
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/swap
|
|
||||||
/usr/lib/lsb/install_initd ${EXTDIR}/init.d/udev
|
|
||||||
|
|
||||||
.PHONY: all create-dirs install minimal
|
|
||||||
|
|
@ -1,92 +0,0 @@
|
|||||||
LSB-Bootscripts README
|
|
||||||
|
|
||||||
The scripts contained in this directory are a complete rewrite of the
|
|
||||||
boot scripts from LFS-6.1. As is usually the case with a rewrite, there have
|
|
||||||
been many changes:
|
|
||||||
|
|
||||||
LSB Version 4.1 Compliant Scripts - Immediately noticable are the LSB headers
|
|
||||||
in the rc.d scripts themselves. Each script contains a usable header to
|
|
||||||
allow for automating both the installation of, and determining proper
|
|
||||||
execution order for the startup scripts. These values can also be used
|
|
||||||
directly in parallel boot setups. Additionally, messages are displayed in
|
|
||||||
one single write to the screen, after exit status is determined, so that
|
|
||||||
they can be used in parallel setups. I am not sure if this was the only
|
|
||||||
barrier to auto language translation in the previous bootscripts. Further,
|
|
||||||
the messages are created from parts and only written to the screen in a
|
|
||||||
single command, so maybe no help at all WRT translated boot messages.
|
|
||||||
|
|
||||||
AS OF 20080907, THESE SCRIPTS REQUIRE THE initd-tools PACKAGE.
|
|
||||||
Dan Nicholson has recently released an initd-tools package that contain
|
|
||||||
LSB compliant install_initd and remove_initd programs written in C.
|
|
||||||
See the INSTALL file for installation instructions.
|
|
||||||
|
|
||||||
Path changes - The base directory for the bootscripts is now /etc. This is
|
|
||||||
mostly to conform with mainstream distros. Of course, this is still
|
|
||||||
configurable in /etc/default/rc.site. The rcsysinit.d directory has been
|
|
||||||
removed and and replaced with the shorter rcS.d. /etc/sysconfig has been
|
|
||||||
removed in favor of /etc/default. The network service scripts have been moved
|
|
||||||
to /lib/network-services and the the network configuration files to
|
|
||||||
/etc/network. Values for short, and relatively static, configuration files
|
|
||||||
(clock and network) have been included in the rc.site file directly.
|
|
||||||
|
|
||||||
Distribution Independent - this original goal for the LFS scripts has been
|
|
||||||
stretched even further by providing both a global rc config file that
|
|
||||||
contains (generally) static values, and a new rc.site config file to allow
|
|
||||||
customization of messages as diplayed to the end user during the boot
|
|
||||||
process. The format of messages printed to the screen is adjustable
|
|
||||||
here. Other options that were available in the previous versions of the
|
|
||||||
lfs-bootscripts, and additional options such as message format and color, are
|
|
||||||
configurable by the /etc/sysconfig/rc.site file.
|
|
||||||
|
|
||||||
Single Environment - The rc script has been rewritten completely to allow a
|
|
||||||
single source of the boot configuration per runlevel change. This config
|
|
||||||
is inherited from rc's environment as opposed to being sourced everytime a
|
|
||||||
script is run. This does result in a negledgable decrease in boot time, but
|
|
||||||
is simply better in principle.
|
|
||||||
|
|
||||||
Boot Logging - The previous incarnation of the boot log didn't begin
|
|
||||||
recording events until the root filesystem was mounted read/write. This has
|
|
||||||
been corrected by providing the /run tempfs mount immediately after init hands
|
|
||||||
control to the rc script. The bootlog is generated on the tempfs and then
|
|
||||||
passed to the log file before login. Additionally, shutdown events are no
|
|
||||||
longer recorded in the bootlog. They were pretty much useless and it really
|
|
||||||
wasn't what I'd call a *boot* log. Boot logging is on by default and is
|
|
||||||
configurable in the /etc/default/rc.site file via the "BOOTLOG_ENAB" parameter.
|
|
||||||
|
|
||||||
Interactive Boot - This feature has been included by default, and is a
|
|
||||||
little more polished than in previous versions. It does introduce a two
|
|
||||||
second delay in the boot process (so that you have time to press a button
|
|
||||||
to select interactive mode). This time value, and the option prompt itself,
|
|
||||||
is configurable in the /etc/default/rc.site file via the "itime" and "iprompt"
|
|
||||||
variables respectively.
|
|
||||||
|
|
||||||
LSB Functions - The previous lfs-bootscripts sourced a functions file
|
|
||||||
located at /etc/rc.d/init.d/functions. This file has been renamed
|
|
||||||
$distro-functions to segregate it from the old. The name is configurable
|
|
||||||
by the rc.site configuration file ("DISTRO_MINI"). LSB defined functions are
|
|
||||||
used where possible througout the individual scripts, but the $distro-functions
|
|
||||||
file provides, easy to use wraper functions that start, stop, reload,
|
|
||||||
force-reload, and restart programs, evaluate the numerical LSB return values,
|
|
||||||
and print status messages to the screen and boot log. Both distro functions and
|
|
||||||
LSB functions are documented directly in the scritps located at
|
|
||||||
/etc/init.d/$distro-functions and /lib/lsb/init-functions respectively.
|
|
||||||
|
|
||||||
Pretier - By default, successful boot messages are prefixed with a single green
|
|
||||||
astrik character, warning messages with two yellow astirks, and failures are
|
|
||||||
prefixed with three red astriks. This provides a second 'quick glance' status
|
|
||||||
when watching the boot messages fly by. Again, the prefixes are configurable
|
|
||||||
(or completely removable) in the /etc/default/rc.site file.
|
|
||||||
|
|
||||||
Complete Rewrite - That doesn't mean that code wasn't reused when possible,
|
|
||||||
so to Alexander Patrakov, Archiac, Bruce Dubbs, Bryan Kadzban, Dan Nicholson,
|
|
||||||
Gerard Beekmans, Jeremy Huntwork, Jim Gifford, Mathias Benkmans, Matthew
|
|
||||||
Burgess, Nathan Coulson, and countless other contributors: Thanks for the help
|
|
||||||
and guidance.
|
|
||||||
|
|
||||||
Please report any bugs to lfs-dev@linuxfromscratch.org.
|
|
||||||
|
|
||||||
Thanks.
|
|
||||||
|
|
||||||
-- DJ Lucas
|
|
||||||
dj@linuxfromscratch.org
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
|||||||
########################################################################
|
|
||||||
# Begin /etc/default/createfiles
|
|
||||||
#
|
|
||||||
# Description : Createfiles script config file
|
|
||||||
#
|
|
||||||
# Authors :
|
|
||||||
#
|
|
||||||
# Version : 00.00
|
|
||||||
#
|
|
||||||
# Notes : The syntax of this file is as follows:
|
|
||||||
# if type is equal to "file" or "dir"
|
|
||||||
# <filename> <type> <permissions> <user> <group>
|
|
||||||
# if type is equal to "dev"
|
|
||||||
# <filename> <type> <permissions> <user> <group> <devtype> <major> <minor>
|
|
||||||
#
|
|
||||||
# <filename> is the name of the file which is to be created
|
|
||||||
# <type> is either file, dir, or dev.
|
|
||||||
# file creates a new file
|
|
||||||
# dir creates a new directory
|
|
||||||
# dev creates a new device
|
|
||||||
# <devtype> is either block, char or pipe
|
|
||||||
# block creates a block device
|
|
||||||
# char creates a character deivce
|
|
||||||
# pipe creates a pipe, this will ignore the <major> and <minor> fields
|
|
||||||
# <major> and <minor> are the major and minor numbers used for the device.
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
# End /etc/sysconfig/createfiles
|
|
@ -1,18 +0,0 @@
|
|||||||
########################################################################
|
|
||||||
# Begin /etc/default/modules
|
|
||||||
#
|
|
||||||
# Description : Module auto-loading configuration
|
|
||||||
#
|
|
||||||
# Authors :
|
|
||||||
#
|
|
||||||
# Version : 00.00
|
|
||||||
#
|
|
||||||
# Notes : The syntax of this file is as follows:
|
|
||||||
# <module> [<arg1> <arg2> ...]
|
|
||||||
#
|
|
||||||
# Each module should be on it's own line, and any options that you want
|
|
||||||
# passed to the module should follow it. The line deliminator is either
|
|
||||||
# a space or a tab.
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
# End /etc/default/modules
|
|
@ -1,106 +0,0 @@
|
|||||||
# Begin /etc/default/rc
|
|
||||||
|
|
||||||
# Global variable inherited by initscripts are in caps
|
|
||||||
# Local variables for the rc script are in lowercase
|
|
||||||
|
|
||||||
# Source site specific rc configuration
|
|
||||||
. /etc/default/rc.site
|
|
||||||
|
|
||||||
# Set base directory information
|
|
||||||
RC_BASE="/etc/rc.d"
|
|
||||||
|
|
||||||
# Location of network device scripts and config files
|
|
||||||
NETWORK_DEVICES="/etc/network"
|
|
||||||
|
|
||||||
# This sets default terminal options.
|
|
||||||
# stty sane - this has been removed as nobody recalls
|
|
||||||
# the reason for it in the first place - if no problems arize,
|
|
||||||
# then it will be removed completely at a later date.
|
|
||||||
|
|
||||||
# Setup default values for the environment
|
|
||||||
umask 022
|
|
||||||
PATH="/bin:/sbin"
|
|
||||||
|
|
||||||
# Find current screen size
|
|
||||||
if [ -z "${COLUMNS}" ]; then
|
|
||||||
COLUMNS=$(stty size)
|
|
||||||
COLUMNS=${COLUMNS##* }
|
|
||||||
fi
|
|
||||||
|
|
||||||
# When using remote connections, such as a serial port, stty size returns 0
|
|
||||||
if [ "${COLUMNS}" = "0" ]; then
|
|
||||||
COLUMNS=80
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Measurements for positioning result messages
|
|
||||||
COL=$((${COLUMNS} - 8))
|
|
||||||
WCOL=$((${COL} - 2))
|
|
||||||
|
|
||||||
# Set Cursur Position Commands, used via echo -e
|
|
||||||
SET_COL="\\033[${COL}G" # at the $COL char
|
|
||||||
SET_WCOL="\\033[${WCOL}G" # at the $WCOL char
|
|
||||||
CURS_UP="\\033[1A\\033[0G" # Up one line, at the 0'th char
|
|
||||||
|
|
||||||
# Distro Information
|
|
||||||
DISTRO="Linux From Scratch" # The distro name
|
|
||||||
DISTRO_CONTACT="lfs-dev@linuxfromscratch.org" # Bug report address
|
|
||||||
DISTRO_MINI="lfs" # Short name used in filenames for distro config
|
|
||||||
|
|
||||||
# Define custom colors used in messages printed to the screen
|
|
||||||
BRACKET="\\033[1;34m" # Blue
|
|
||||||
FAILURE="\\033[1;31m" # Red
|
|
||||||
INFO="\\033[1;36m" # Cyan
|
|
||||||
NORMAL="\\033[0;39m" # Grey
|
|
||||||
SUCCESS="\\033[1;32m" # Green
|
|
||||||
WARNING="\\033[1;33m" # Yellow
|
|
||||||
|
|
||||||
# Prefix boot messages for easier reading on framebuffer consoles
|
|
||||||
PREFIX_SUCCESS=" ${SUCCESS}*${NORMAL} "
|
|
||||||
PREFIX_WARNING="${WARNING}**${NORMAL} "
|
|
||||||
PREFIX_FAILURE="${FAILURE}***${NORMAL}"
|
|
||||||
|
|
||||||
# Export the environment variables so they are inherited by the scripts
|
|
||||||
export RC_BASE NETWORK_DEVICES PATH SET_COL SET_WCOL CURS_UP
|
|
||||||
export DISTRO DISTRO_CONTACT DISTRO_MINI
|
|
||||||
export BRACKET FAILURE INFO NORMAL SUCCESS WARNING
|
|
||||||
export PREFIX_SUCCESS PREFIX_WARNING PREFIX_FAILURE
|
|
||||||
|
|
||||||
# Interactive startup
|
|
||||||
dlen="29" # The total length of the distro welcome string
|
|
||||||
ilen="38" # The total length of the interactive message
|
|
||||||
welcome_message="Welcome to ${INFO}${DISTRO}${NORMAL}"
|
|
||||||
i_message="Press '${FAILURE}I${NORMAL}' to enter interactive startup"
|
|
||||||
|
|
||||||
# FAILURE_ACTION (what to do when script failure occurs)
|
|
||||||
case "${stop_on_error}" in
|
|
||||||
Y* | y* | 0)
|
|
||||||
FAILURE_ACTION='read Enter'
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
FAILURE_ACTION='echo ""'
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Error message displayed when a script's exit value is not zero
|
|
||||||
print_error_msg()
|
|
||||||
{
|
|
||||||
# ${link} and ${error_value} are defined by the rc script
|
|
||||||
echo -e "${FAILURE}FAILURE: You should not be reading this error message."
|
|
||||||
echo -e ""
|
|
||||||
echo -e -n "${FAILURE}It means that an unforseen error took place in"
|
|
||||||
echo -e -n "${INFO} ${link}"
|
|
||||||
echo -e "${FAILURE},"
|
|
||||||
echo -e "${FAILURE}which exited with a return value of ${error_value}."
|
|
||||||
echo -e ""
|
|
||||||
echo -e -n "${FAILURE}If you are able to track this error down to a bug"
|
|
||||||
echo -e "${FAILURE}in one of the files"
|
|
||||||
echo -e -n "provided by ${INFO}${DISTRO}${FAILURE}, "
|
|
||||||
echo -e -n "${FAILURE}please be so kind to inform us at "
|
|
||||||
echo -e "${INFO}${DISTRO_CONTACT}${FAILURE}.${NORMAL}"
|
|
||||||
echo -e ""
|
|
||||||
echo -e "${INFO}Press Enter to continue..."
|
|
||||||
echo -e "${NORMAL}"
|
|
||||||
$FAILURE_ACTION
|
|
||||||
}
|
|
||||||
|
|
||||||
# End /etc/default/rc
|
|
@ -1,27 +0,0 @@
|
|||||||
# Begin /etc/default/rc.site
|
|
||||||
|
|
||||||
# Global variable inherited by initscripts are in caps
|
|
||||||
# Local variables for the rc script are in lowercase
|
|
||||||
|
|
||||||
# Bootlogging (requires a tempfs mount)
|
|
||||||
BOOTLOG_ENAB="yes"
|
|
||||||
|
|
||||||
# Hostname
|
|
||||||
HOSTNAME=<lfs>
|
|
||||||
|
|
||||||
# System time variables
|
|
||||||
UTC=1
|
|
||||||
CLOCKPARAMS=
|
|
||||||
|
|
||||||
# Export varialbles so that they are inherited by the initscripts
|
|
||||||
export BOOTLOG_ENAB HOSTNAME UTC CLOCKPARAMS
|
|
||||||
|
|
||||||
# Interactive startup
|
|
||||||
iprompt="yes" # Wether to display the interactive boot promp
|
|
||||||
itime="2" # The ammount of time (in seconds) to display the prompt
|
|
||||||
|
|
||||||
# Manual input is not appropriate on remote systems. Wait for user input on
|
|
||||||
# script error?
|
|
||||||
stop_on_error="yes"
|
|
||||||
|
|
||||||
# End /etc/default/rc.site
|
|
@ -1,103 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Begin $RC_BASE/init.d/checkfs
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: checkfs
|
|
||||||
# Required-Start: udev swap
|
|
||||||
# Should-Start:
|
|
||||||
# Required-Stop:
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: S
|
|
||||||
# Default-Stop:
|
|
||||||
# Short-Description: Checks local filesystems before mounting.
|
|
||||||
# Description: Checks local filesystmes before mounting.
|
|
||||||
# X-LFS-Provided-By: LFS
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
start)
|
|
||||||
if [ -f /fastboot ]; then
|
|
||||||
echo "${INFO}/fastboot found!"
|
|
||||||
log_success_msg "Will not perform file system checks as requested."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
mount -n -o remount,ro / >/dev/null
|
|
||||||
if [ ${?} -ne 0 ]
|
|
||||||
then
|
|
||||||
log_failure_msg "Mounting root file system in read-only mode"
|
|
||||||
echo -e "${FAILURE}FAILURE:\n"
|
|
||||||
echo -e -n "${FAILURE}Cannot check root filesystem because it "
|
|
||||||
echo -e "${FAILURE}could not be mounted"
|
|
||||||
echo -e "${FAILURE}in read-only mode.\n\n"
|
|
||||||
echo -e -n "${FAILURE}After you press Enter, this system will be "
|
|
||||||
echo -e "${FAILURE}halted and powered off.\n"
|
|
||||||
echo -e "${INFO}Press enter to continue...${NORMAL}"
|
|
||||||
$FAILURE_ACTION
|
|
||||||
/etc/rc.d/init.d/halt stop
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f /forcefsck ]
|
|
||||||
then
|
|
||||||
echo "${INFO}/forcefsck found!"
|
|
||||||
log_success_msg "${INFO}Forcing file system checks as requested."
|
|
||||||
options="-f"
|
|
||||||
else
|
|
||||||
options=""
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Note: -a option used to be -p; but this fails e.g.
|
|
||||||
# on fsck.minix
|
|
||||||
fsck ${options} -a -A -C -T
|
|
||||||
error_value=${?}
|
|
||||||
|
|
||||||
if [ "${error_value}" -eq 0 ]
|
|
||||||
then
|
|
||||||
log_success_msg "Checking file systems..."
|
|
||||||
elif [ "${error_value}" -eq 1 ]
|
|
||||||
then
|
|
||||||
log_warning_msg "Checking file systems..."
|
|
||||||
echo -e "${WARNING}WARNING:\n"
|
|
||||||
echo -e "${WARNING}File system errors were found and have been"
|
|
||||||
echo -e "${WARNING}corrected. You may want to double-check that"
|
|
||||||
echo -e "${WARNING}everything was fixed properly.${NORMAL}"
|
|
||||||
elif [ "${error_value}" -eq 2 -o "${error_value}" -eq 3 ]; then
|
|
||||||
log_warning_msg "Checking file systems..."
|
|
||||||
echo -e "${WARNING}WARNING:\n"
|
|
||||||
echo -e "${WARNING}File system errors were found and have been been"
|
|
||||||
echo -e "${WARNING}corrected, but the nature of the errors require"
|
|
||||||
echo -e "${WARNING}this system to be rebooted.\n"
|
|
||||||
echo -e "After you press enter, this system will be rebooted.\n"
|
|
||||||
echo -e "${INFO}Press Enter to continue...${NORMAL}"
|
|
||||||
$FAILURE_ACTION
|
|
||||||
reboot -f
|
|
||||||
elif [ "${error_value}" -gt 3 -a "${error_value}" -lt 16 ]; then
|
|
||||||
log_failure_msg "Checking file systems..."
|
|
||||||
echo -e "${FAILURE}FAILURE:\n"
|
|
||||||
echo -e "${FAILURE}File system errors were encountered that could"
|
|
||||||
echo -e "${FAILURE}not be fixed automatically. This system cannot"
|
|
||||||
echo -e "${FAILURE}continue to boot and will therefore be halted"
|
|
||||||
echo -e "${FAILURE}until those errors are fixed manually by a"
|
|
||||||
echo -e "${FAILURE}System Administrator.\n"
|
|
||||||
echo -e "${FAILURE}After you press Enter, this system will be"
|
|
||||||
echo -e "${FAILURE}halted and powered off.\n"
|
|
||||||
echo -e "${INFO}Press Enter to continue...${NORMAL}"
|
|
||||||
$FAILURE_ACTION
|
|
||||||
/etc/rc.d/init.d/halt stop
|
|
||||||
elif [ "${error_value}" -ge 16 ]; then
|
|
||||||
log_failure_msg "Checking file systems..."
|
|
||||||
echo -e "${FAILURE}FAILURE:\n"
|
|
||||||
echo -e "${FAILURE}Unexpected Failure running fsck. Exited with error"
|
|
||||||
echo -e "${FAILURE}code: ${error_value}.${NORMAL}"
|
|
||||||
exit ${error_value}
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: ${0} {start}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End $RC_BASE/init.d/checkfs
|
|
@ -1,105 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Begin $RC_BASE/init.d/cleanfs
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: cleanfs
|
|
||||||
# Required-Start: $local_fs
|
|
||||||
# Should-Start:
|
|
||||||
# Required-Stop:
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: S
|
|
||||||
# Default-Stop:
|
|
||||||
# Short-Description: Cleans and prepares the temporary directory.
|
|
||||||
# Description: Cleans the temporary directory /tmp and creates the
|
|
||||||
# /var/run/utmp file and any other files defined in
|
|
||||||
# /etc/default/createfiles.
|
|
||||||
# X-LFS-Provided-By: LFS
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
# Function to create files/directory on boot.
|
|
||||||
create_files()
|
|
||||||
{
|
|
||||||
# Read in the configuration file.
|
|
||||||
exec 9>&0 < /etc/default/createfiles
|
|
||||||
while read name type perm usr grp dtype maj min junk
|
|
||||||
do
|
|
||||||
# Ignore comments and blank lines.
|
|
||||||
case "${name}" in
|
|
||||||
""|\#*) continue ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Ignore existing files.
|
|
||||||
if [ ! -e "${name}" ]
|
|
||||||
then
|
|
||||||
# Create stuff based on its type.
|
|
||||||
case "${type}" in
|
|
||||||
dir)
|
|
||||||
mkdir "${name}"
|
|
||||||
;;
|
|
||||||
file)
|
|
||||||
:> "${name}"
|
|
||||||
;;
|
|
||||||
dev)
|
|
||||||
case "${dtype}" in
|
|
||||||
char)
|
|
||||||
mknod "${name}" c ${maj} ${min}
|
|
||||||
;;
|
|
||||||
block)
|
|
||||||
mknod "${name}" b ${maj} ${min}
|
|
||||||
;;
|
|
||||||
pipe)
|
|
||||||
mknod "${name}" p
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo -e -n "\n${WARNING}Unknown device type: ${dtype}"
|
|
||||||
echo -e "${NORMAL}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo -e "\n${WARNING}Unknown type: ${type}${NORMAL}"
|
|
||||||
continue
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Set up the permissions, too.
|
|
||||||
chown ${usr}:${grp} "${name}"
|
|
||||||
chmod ${perm} "${name}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
exec 0>&9 9>&-
|
|
||||||
}
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
start)
|
|
||||||
message="Cleaning file systems: "
|
|
||||||
|
|
||||||
message="${message}${INFO} /tmp"
|
|
||||||
find /tmp -xdev -mindepth 1 ! -name lost+found \
|
|
||||||
-delete || failed=1
|
|
||||||
|
|
||||||
> /var/run/utmp
|
|
||||||
if grep -q '^utmp:' /etc/group ; then
|
|
||||||
chmod 664 /var/run/utmp
|
|
||||||
chgrp utmp /var/run/utmp
|
|
||||||
fi
|
|
||||||
|
|
||||||
(exit ${failed})
|
|
||||||
evaluate_retval standard
|
|
||||||
|
|
||||||
if egrep -qv '^(#|$)' /etc/default/createfiles 2>/dev/null
|
|
||||||
then
|
|
||||||
message="Creating files and directories..."
|
|
||||||
create_files
|
|
||||||
evaluate_retval standard
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: ${0} {start}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End $RC_BASE/init.d/cleanfs
|
|
@ -1,96 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Begin $RC_BASE/init.d/console
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: console
|
|
||||||
# Required-Start:
|
|
||||||
# Should-Start: $local_fs
|
|
||||||
# Required-Stop:
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: S
|
|
||||||
# Default-Stop:
|
|
||||||
# Short-Description: Sets up a localised console.
|
|
||||||
# Description: Sets up fonts and language settings for the user's
|
|
||||||
# local as defined by /etc/default/console.
|
|
||||||
# X-LFS-Provided-By: LFS
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
MESSAGE="Setting up Linux console..."
|
|
||||||
|
|
||||||
# Native English speakers probably don't have /etc/default/console at all
|
|
||||||
if [ -f /etc/default/console ]
|
|
||||||
then
|
|
||||||
. /etc/default/console
|
|
||||||
fi
|
|
||||||
|
|
||||||
is_true() {
|
|
||||||
[ "$1" = "1" ] || [ "$1" = "yes" ] || [ "$1" = "true" ]
|
|
||||||
}
|
|
||||||
|
|
||||||
failed=0
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
start)
|
|
||||||
# There should be no bogus failures below this line!
|
|
||||||
|
|
||||||
# Figure out if a framebuffer console is used
|
|
||||||
[ -d /sys/class/graphics/fb0 ] && USE_FB=1 || USE_FB=0
|
|
||||||
|
|
||||||
# Figure out the command to set the console into the
|
|
||||||
# desired mode
|
|
||||||
is_true "${UNICODE}" &&
|
|
||||||
MODE_COMMAND="echo -en '\033%G' && kbd_mode -u" ||
|
|
||||||
MODE_COMMAND="echo -en '\033%@\033(K' && kbd_mode -a"
|
|
||||||
|
|
||||||
# On framebuffer consoles, font has to be set for each vt in
|
|
||||||
# UTF-8 mode. This doesn't hurt in non-UTF-8 mode also.
|
|
||||||
|
|
||||||
! is_true "${USE_FB}" || [ -z "${FONT}" ] ||
|
|
||||||
MODE_COMMAND="${MODE_COMMAND} && setfont ${FONT}"
|
|
||||||
|
|
||||||
# Apply that command to all consoles mentioned in
|
|
||||||
# /etc/inittab. Important: in the UTF-8 mode this should
|
|
||||||
# happen before setfont, otherwise a kernel bug will
|
|
||||||
# show up and the unicode map of the font will not be
|
|
||||||
# used.
|
|
||||||
# FIXME: Fedora Core also initializes two spare consoles
|
|
||||||
# - do we want that?
|
|
||||||
|
|
||||||
for TTY in `grep '^[^#].*respawn:/sbin/agetty' /etc/inittab |
|
|
||||||
grep -o '\btty[[:digit:]]*\b'`
|
|
||||||
do
|
|
||||||
openvt -f -w -c ${TTY#tty} -- \
|
|
||||||
/bin/sh -c "${MODE_COMMAND}" || failed=1
|
|
||||||
done
|
|
||||||
|
|
||||||
# Set the font (if not already set above) and the keymap
|
|
||||||
is_true "${USE_FB}" || [ -z "${FONT}" ] ||
|
|
||||||
setfont $FONT ||
|
|
||||||
failed=1
|
|
||||||
[ -z "${KEYMAP}" ] ||
|
|
||||||
loadkeys ${KEYMAP} >/dev/null 2>&1 ||
|
|
||||||
failed=1
|
|
||||||
[ -z "${KEYMAP_CORRECTIONS}" ] ||
|
|
||||||
loadkeys ${KEYMAP_CORRECTIONS} >/dev/null 2>&1 ||
|
|
||||||
failed=1
|
|
||||||
|
|
||||||
# Convert the keymap from $LEGACY_CHARSET to UTF-8
|
|
||||||
[ -z "$LEGACY_CHARSET" ] ||
|
|
||||||
dumpkeys -c "$LEGACY_CHARSET" |
|
|
||||||
loadkeys -u >/dev/null 2>&1 ||
|
|
||||||
failed=1
|
|
||||||
|
|
||||||
# If any of the commands above failed, the trap at the
|
|
||||||
# top would set $failed to 1
|
|
||||||
( exit $failed )
|
|
||||||
evaluate_retval standard
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo $"Usage:" "${0} {start}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End $RC_BASE/init.d/console
|
|
@ -1,30 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Begin $RC_BASE/init.d/halt
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: halt
|
|
||||||
# Required-Start:
|
|
||||||
# Should-Start:
|
|
||||||
# Required-Stop:
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: 0
|
|
||||||
# Default-Stop:
|
|
||||||
# Short-Description: Halts the system.
|
|
||||||
# Description: Halts the System.
|
|
||||||
# X-LFS-Provided-By: LFS
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
stop)
|
|
||||||
log_success_msg "Halting System..."
|
|
||||||
halt -d -f -i -p
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: {stop}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End $RC_BASE/init.d/halt
|
|
@ -1,81 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Begin $RC_BASE/init.d/localnet
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: localnet
|
|
||||||
# Required-Start: $local_fs
|
|
||||||
# Should-Start:
|
|
||||||
# Required-Stop:
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: S
|
|
||||||
# Default-Stop: 0 6
|
|
||||||
# Short-Description: Starts the local network.
|
|
||||||
# Description: Sets the hostname of the machine and starts the
|
|
||||||
# loopback interface.
|
|
||||||
# X-LFS-Provided-By: LFS
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
start)
|
|
||||||
ip addr add 127.0.0.1/8 label lo dev lo
|
|
||||||
ip link set lo up
|
|
||||||
if [ "${?}" -eq "0" ]
|
|
||||||
then
|
|
||||||
log_success_msg "Bringing up the loopback interface..."
|
|
||||||
else
|
|
||||||
log_failure_msg "Bringing up the loopback interface..."
|
|
||||||
fi
|
|
||||||
|
|
||||||
hostname "${HOSTNAME}"
|
|
||||||
if [ "${?}" -eq "0" ]
|
|
||||||
then
|
|
||||||
log_success_msg "Setting hostname to ${HOSTNAME}..."
|
|
||||||
else
|
|
||||||
log_failure_msg "Setting hostname to ${HOSTNAME}..."
|
|
||||||
fi
|
|
||||||
|
|
||||||
;;
|
|
||||||
|
|
||||||
stop)
|
|
||||||
ip link set lo down
|
|
||||||
if [ "${?}" -eq "0" ]
|
|
||||||
then
|
|
||||||
log_success_msg "Bringing down the loopback interface..."
|
|
||||||
else
|
|
||||||
log_failure_msg "Bringing down the loopback interface..."
|
|
||||||
fi
|
|
||||||
|
|
||||||
;;
|
|
||||||
|
|
||||||
restart)
|
|
||||||
ip link set lo down
|
|
||||||
retval="${?}"
|
|
||||||
sleep 1
|
|
||||||
ip addr add 127.0.0.1/8 label lo dev lo
|
|
||||||
retval=$(( "${retval}" + "${?}" ))
|
|
||||||
ip link set lo up
|
|
||||||
retval=$(( "${retval}" + "${?}" ))
|
|
||||||
hostname "${HOSTNAME}"
|
|
||||||
retval=$(( "${retval}" + "${?}" ))
|
|
||||||
if [ "${retval}" -eq "0" ]
|
|
||||||
then
|
|
||||||
log_success_msg "Restarting local network..."
|
|
||||||
else
|
|
||||||
log_failure_msg "Restarting local network..."
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
status)
|
|
||||||
log_success_msg "Hostname is: ${INFO}$(hostname)${NORMAL}"
|
|
||||||
ip link show lo
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Usage: ${0} {start|stop|restart|status}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End $RC_BASE/init.d/localnet
|
|
@ -1,97 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Begin $RC_BASE/init.d/modules
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: modules
|
|
||||||
# Required-Start: mountvirtfs sysctl
|
|
||||||
# Should-Start:
|
|
||||||
# Required-Stop:
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: S
|
|
||||||
# Default-Stop:
|
|
||||||
# Short-Description: Loads required modules.
|
|
||||||
# Description: Loads modules listed in /etc/default/modules.
|
|
||||||
# X-LFS-Provided-By: LFS
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
# Assure that the kernel has module support.
|
|
||||||
[ -e /proc/ksyms -o -e /proc/modules ] || exit 0
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
start)
|
|
||||||
|
|
||||||
# Exit if there's no modules file or there are no
|
|
||||||
# valid entries
|
|
||||||
[ -r /etc/default/modules ] &&
|
|
||||||
egrep -qv '^($|#)' /etc/default/modules ||
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
# If proc is mounted, find the current kernel
|
|
||||||
# message level
|
|
||||||
if [ -f /proc/sys/kernel/printk ]; then
|
|
||||||
prev_msg=`cat /proc/sys/kernel/printk | \
|
|
||||||
sed 'l 1' | sed -n '2~0p' | \
|
|
||||||
sed 's/\\\//'`
|
|
||||||
else
|
|
||||||
prev_msg="6"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Now set the message level to 1 so not to make too
|
|
||||||
# much noise when loading modules
|
|
||||||
dmesg -n 1
|
|
||||||
|
|
||||||
# Only try to load modules if the user has actually given us
|
|
||||||
# some modules to load.
|
|
||||||
if egrep -qv '^(#|$)' /etc/default/modules 2>/dev/null
|
|
||||||
then
|
|
||||||
|
|
||||||
# Read in the configuration file.
|
|
||||||
exec 9>&0 < /etc/default/modules
|
|
||||||
|
|
||||||
message="${INFO}Loading modules:"
|
|
||||||
|
|
||||||
while read module args
|
|
||||||
do
|
|
||||||
# Ignore comments and blank lines.
|
|
||||||
case "${module}" in
|
|
||||||
""|\#*) continue ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Attempt to load the module, making
|
|
||||||
# sure to pass any arguments provided.
|
|
||||||
modprobe ${module} ${args} > /dev/null
|
|
||||||
|
|
||||||
# Print the module name if successful,
|
|
||||||
# otherwise take note.
|
|
||||||
if [ ${?} -eq 0 ]; then
|
|
||||||
message="${message}${NORMAL} ${module}"
|
|
||||||
else
|
|
||||||
failedmod="${failedmod} ${module}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Print a message about successfully loaded
|
|
||||||
# modules on the correct line.
|
|
||||||
log_success_msg "${message}"
|
|
||||||
|
|
||||||
# Print a failure message with a list of any
|
|
||||||
# modules that may have failed to load.
|
|
||||||
if [ "${failedmod}" ]; then
|
|
||||||
log_failure_msg "${FAILURE}Failed to load modules:${failedmod}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec 0>&9 9>&-
|
|
||||||
|
|
||||||
fi
|
|
||||||
# Set the kernel message level back to it's previous value.
|
|
||||||
dmesg -n "${prev_msg}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: ${0} {start}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End $RC_BASE/init.d/modules
|
|
@ -1,59 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Begin $RC_BASE/init.d/mountfs
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: $local_fs
|
|
||||||
# Required-Start: udev checkfs
|
|
||||||
# Should-Start:
|
|
||||||
# Required-Stop: swap
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: S
|
|
||||||
# Default-Stop: 0 6
|
|
||||||
# Short-Description: Mounts/unmounts local filesystems defined in /etc/fstab.
|
|
||||||
# Description: Remounts root filesystem read/write and mounts all
|
|
||||||
# remaining local filesystems defined in /etc/fstab on
|
|
||||||
# start. Remounts root filesystem read-only and unmounts
|
|
||||||
# remaining filesystems on stop.
|
|
||||||
# X-LFS-Provided-By: LFS
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
start)
|
|
||||||
message="Remounting root file system in read-write mode..."
|
|
||||||
mount -n -o remount,rw / >/dev/null
|
|
||||||
evaluate_retval standard
|
|
||||||
|
|
||||||
# Remove fsck-related file system watermarks.
|
|
||||||
rm -f /fastboot /forcefsck
|
|
||||||
|
|
||||||
message="Recording existing mounts in /etc/mtab..."
|
|
||||||
> /etc/mtab
|
|
||||||
mount -f / || failed=1
|
|
||||||
mount -f /proc || failed=1
|
|
||||||
mount -f /sys || failed=1
|
|
||||||
mount -f /run || failed=1
|
|
||||||
(exit ${failed})
|
|
||||||
evaluate_retval standard
|
|
||||||
|
|
||||||
# This will mount all filesystems that do not have _netdev in
|
|
||||||
# their option list. _netdev denotes a network filesystem.
|
|
||||||
message="Mounting remaining file systems..."
|
|
||||||
mount -a -O no_netdev >/dev/null
|
|
||||||
evaluate_retval standard
|
|
||||||
;;
|
|
||||||
|
|
||||||
stop)
|
|
||||||
message="Unmounting all other currently mounted file systems..."
|
|
||||||
umount -a -d -r >/dev/null
|
|
||||||
evaluate_retval standard
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Usage: ${0} {start|stop}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End $RC_BASE/init.d/mountfs
|
|
@ -1,47 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Begin $RC_BASE/init.d/mountvirtfs
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: mountvirtfs
|
|
||||||
# Required-Start:
|
|
||||||
# Should-Start:
|
|
||||||
# Required-Stop:
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: S
|
|
||||||
# Default-Stop:
|
|
||||||
# Short-Description: Mounts /sys, /proc, and /run virtual (kernel) filesystems.
|
|
||||||
# Description: Mounts /sys, /proc, and run virtual (kernel) filesystems.
|
|
||||||
# X-LFS-Provided-By: LFS
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
start)
|
|
||||||
message="Mounting virtual file systems:"
|
|
||||||
|
|
||||||
if ! mountpoint /proc > /dev/null; then
|
|
||||||
message="${message}${INFO} /proc${NORMAL}"
|
|
||||||
mount -n /proc || failed=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! mountpoint /sys > /dev/null; then
|
|
||||||
message="${message}${INFO} /sys${NORMAL}"
|
|
||||||
mount -n /sys || failed=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# create needed directories in /run
|
|
||||||
mkdir /run/{var,lock,shm} || failed=1
|
|
||||||
chmod 1777 /run/shm
|
|
||||||
|
|
||||||
(exit ${failed})
|
|
||||||
evaluate_retval standard
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Usage: ${0} {start}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End $RC_BASE/init.d/mountvirtfs
|
|
@ -1,84 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Begin $RC_BASE/init.d/network
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: $network
|
|
||||||
# Required-Start: $local_fs swap localnet
|
|
||||||
# Should-Start: $syslog
|
|
||||||
# Required-Stop: $local_fs swap localnet
|
|
||||||
# Should-Stop: $syslog
|
|
||||||
# Default-Start: 3 4 5
|
|
||||||
# Default-Stop: 0 1 2 6
|
|
||||||
# Short-Description: Starts and configures network interfaces.
|
|
||||||
# Description: Starts and configures network interfaces.
|
|
||||||
# X-LFS-Provided-By: LFS
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
start)
|
|
||||||
# Start all network interfaces
|
|
||||||
for dir in ${NETWORK_DEVICES}/ifconfig.*
|
|
||||||
do
|
|
||||||
interface=${dir##*/ifconfig.}
|
|
||||||
# skip if $dir is * (because nothing was found)
|
|
||||||
if [ "${interface}" = "*" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
# Process individual configuration files
|
|
||||||
for file in "${dir}"/* ; do
|
|
||||||
ONBOOT=`grep "ONBOOT" "${file}" | sed 's@^ONBOOT=@@'`
|
|
||||||
case "${ONBOOT}" in
|
|
||||||
Y* | y* | 0)
|
|
||||||
/sbin/ifup -c "${file}" "${interface}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
|
|
||||||
stop)
|
|
||||||
# Reverse list
|
|
||||||
DIRS=""
|
|
||||||
for dir in /run/network/ifconfig.*
|
|
||||||
do
|
|
||||||
DIRS="${dir} ${DIRS}"
|
|
||||||
done
|
|
||||||
|
|
||||||
# Stop all network interfaces
|
|
||||||
for dir in ${DIRS}; do
|
|
||||||
interface=${dir##*/ifconfig.}
|
|
||||||
# skip if $dir is * (because nothing was found)
|
|
||||||
if [ "${interface}" = "*" ]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
# Process individual configuration files
|
|
||||||
for file in "${dir}"/* ; do
|
|
||||||
# No checking necessary if it is in /run/network
|
|
||||||
/sbin/ifdown -c "${file}" "${interface}"
|
|
||||||
done
|
|
||||||
link_status=`/sbin/ip link show "${interface}" | \
|
|
||||||
grep -o "state DOWN"`
|
|
||||||
if [ "${link_status}" != "state DOWN" ]; then
|
|
||||||
message="Shutting down the ${interface} interface..."
|
|
||||||
/sbin/ip addr flush "${interface}" &&
|
|
||||||
/sbin/ip link set "${interface}" down
|
|
||||||
evaluate_retval standard
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
;;
|
|
||||||
|
|
||||||
restart)
|
|
||||||
${0} stop
|
|
||||||
sleep 1
|
|
||||||
${0} start
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Usage: ${0} {start|stop|restart}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End $RC_BASE/init.d/network
|
|
@ -1,201 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Begin $RC_BASE/init.d/rc
|
|
||||||
|
|
||||||
# Get the configuration file
|
|
||||||
# All changes are to occur in the config file
|
|
||||||
. /etc/default/rc
|
|
||||||
|
|
||||||
# These 3 signals will not cause our script to exit
|
|
||||||
trap "" INT QUIT TSTP
|
|
||||||
|
|
||||||
# Simple sanity check - rc only takes one argument
|
|
||||||
if [ "${#}" -ne 1 ]; then
|
|
||||||
echo "Usage: ${0} <runlevel>" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Do not use the RUNLEVEL and PREVLEVEL variables provided by init so
|
|
||||||
# that they can be modified and alternate directories (S) can
|
|
||||||
# be used without affecting init
|
|
||||||
runlevel="${1}"
|
|
||||||
prevlevel="${PREVLEVEL}"
|
|
||||||
|
|
||||||
# Just in case - some flavors of init don't set PREVLEVEL to 'N'
|
|
||||||
if [ "${prevlevel}" = "" ]; then
|
|
||||||
prevlevel="N"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Mount /run
|
|
||||||
if [ "${runlevel}" = "S" ]; then
|
|
||||||
mount -n -t tmpfs tmpfs /run
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Provide an interactive prompt (if requested)
|
|
||||||
if [ "${runlevel}" = "S" -a "${iprompt}" = "yes" ]; then
|
|
||||||
# ash does not accept t and n flags for read
|
|
||||||
ls -l /bin/sh | grep "/ash"
|
|
||||||
if [ "${?}" -eq "0" ]; then
|
|
||||||
# We are using ash
|
|
||||||
echo -e -n "${WARNING}WARNING: Either bash or zsh is required"
|
|
||||||
echo -e "${WARNING} for interactive startup.\n"
|
|
||||||
sleep 3
|
|
||||||
else
|
|
||||||
echo ""
|
|
||||||
# dcol and icol are spaces before the message to center the
|
|
||||||
# message on screen.
|
|
||||||
dcol=$(( $(( ${COLUMNS} - ${dlen} )) / 2 ))
|
|
||||||
icol=$(( $(( ${COLUMNS} - ${ilen} )) / 2 ))
|
|
||||||
echo -e "\\033[${dcol}G${welcome_message}"
|
|
||||||
echo -e "\\033[${icol}G${i_message}${NORMAL}"
|
|
||||||
echo ""
|
|
||||||
read -t "${itime}" -n 1 interactive 2>&1 > /dev/null
|
|
||||||
if [ "${interactive}" = "I" -o "${interactive}" = "i" ]; then
|
|
||||||
echo -n -e "${CURS_UP}"
|
|
||||||
echo -e "${INFO}Interactive boot selected...${NORMAL}"
|
|
||||||
echo "interactive=I" > /run/.interactive-start
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Verify that the directory exists
|
|
||||||
if [ ! -d "${RC_BASE}/rc${runlevel}.d" ]; then
|
|
||||||
echo -n -e "${WARNING}${RC_BASE}/rc${runlevel}.d does not exist."
|
|
||||||
echo -e "${NORMAL}"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Source the interactive state file if it exists
|
|
||||||
if [ "${runlevel}" != "S" -a -f /run/.interactive-start ]; then
|
|
||||||
. /run/.interactive-start
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Prompt for interactive startup after completing S
|
|
||||||
if [ "${interactive}" = "I" -a "${runlevel}" != "S" -a \
|
|
||||||
"${runlevel}" != "0" -a "${runlevel}" != "6" ]; then
|
|
||||||
echo -n -e "Proceed with interactive starup of runlevel "
|
|
||||||
echo -n -e "${INFO}${runlevel}${NORMAL}?"
|
|
||||||
echo -n -e "(${FAILURE}y${NORMAL})es/(${FAILURE}n${NORMAL})o "
|
|
||||||
read -n 1 go_on
|
|
||||||
echo ""
|
|
||||||
if [ "${go_on}" = "n" ]; then
|
|
||||||
# don't continue
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Attempt to stop all services started in the previous runlevel,
|
|
||||||
# that are stopped in this runlevel
|
|
||||||
if [ "${prevlevel}" != "N" ]; then
|
|
||||||
for link in $(ls -v ${RC_BASE}/rc${runlevel}.d/K* 2> /dev/null)
|
|
||||||
do
|
|
||||||
# Check to see if link is a valid symlink
|
|
||||||
if [ ! -f ${link} ]; then
|
|
||||||
echo -e "${WARNING}${link} is not a valid symlink."
|
|
||||||
continue # go on to the next K* link
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check to see if link is executable
|
|
||||||
if [ ! -x ${link} ]; then
|
|
||||||
echo -e "${WARNING}${link} is not executable, skipping."
|
|
||||||
continue # go on to the next K* link
|
|
||||||
fi
|
|
||||||
|
|
||||||
script=${link#$RC_BASE/rc$runlevel.d/K[0-9][0-9]}
|
|
||||||
prev_start=$RC_BASE/rc$prevlevel.d/S[0-9][0-9]$script
|
|
||||||
S_start=$RC_BASE/rcS.d/S[0-9][0-9]$script
|
|
||||||
|
|
||||||
if [ "${runlevel}" != "0" -a "${runlevel}" != "6" ]; then
|
|
||||||
if [ ! -f ${prev_start} ] && [ ! -f ${S_start} ]; then
|
|
||||||
echo -e -n "${WARNING}WARNING:\n\n${link} can't be"
|
|
||||||
echo -e "${WARNING} executed because it was not"
|
|
||||||
echo -e -n "${WARNING} not started in the previous"
|
|
||||||
echo -e "${WARNING} runlevel (${prevlevel})."
|
|
||||||
echo -e "${NORMAL}"
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
${link} stop
|
|
||||||
error_value=${?}
|
|
||||||
|
|
||||||
if [ "${error_value}" -ne "0" ]; then
|
|
||||||
print_error_msg
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Start all functions in this runlevel if they weren't started in
|
|
||||||
# the previous runlevel
|
|
||||||
for link in $(ls -v ${RC_BASE}/rc${runlevel}.d/S* 2> /dev/null)
|
|
||||||
do
|
|
||||||
if [ "${prevlevel}" != "N" ]; then
|
|
||||||
script=${link#$RC_BASE/rc$runlevel.d/S[0-9][0-9]}
|
|
||||||
stop=$RC_BASE/rc$runlevel.d/K[0-9][0-9]$script
|
|
||||||
prev_start=$RC_BASE/rc$prevlevel.d/S[0-9][0-9]$script
|
|
||||||
|
|
||||||
[ -f ${prev_start} ] && [ ! -f ${stop} ] && continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check to see if link is a valid symlink
|
|
||||||
if [ ! -f ${link} ]; then
|
|
||||||
echo -e "${WARNING}${link} is not a valid symlink."
|
|
||||||
continue # go on to the next K* link
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check to see if link is executable
|
|
||||||
if [ ! -x ${link} ]; then
|
|
||||||
echo -e "${WARNING}${link} is not executable, skipping."
|
|
||||||
continue # go on to the next K* link
|
|
||||||
fi
|
|
||||||
|
|
||||||
case ${runlevel} in
|
|
||||||
0|6)
|
|
||||||
${link} stop
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
if [ "${interactive}" = "I" -o "${interactive}" = "i" ]; then
|
|
||||||
echo -e -n "${WARNING}Start ${INFO}${link} ${WARNING}?"
|
|
||||||
echo -e -n "${NORMAL}(${FAILURE}y${NORMAL})es/(${FAILURE}n${NORMAL})o "
|
|
||||||
read -n 1 startit 2>&1 > /dev/null
|
|
||||||
echo ""
|
|
||||||
if [ "${startit}" = "y" -o "${startit}" = "Y" ]; then
|
|
||||||
${link} start
|
|
||||||
else
|
|
||||||
echo -e -n "${WARNING}Not starting ${INFO}${link}"
|
|
||||||
echo -e "${WARNING}.${NORMAL}\n"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
${link} start
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
error_value=${?}
|
|
||||||
|
|
||||||
if [ "${error_value}" -gt "1" ]; then
|
|
||||||
print_error_msg
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Strip apply time to the logs, strip out any color codes and dump
|
|
||||||
# the log to /var/log/boot.log
|
|
||||||
if [ -f /run/.bootlog -a "${runlevel}" != "S" ]; then
|
|
||||||
# Remove any color codes from the temp log file
|
|
||||||
sed -i 's@\\033\[[0-9];[0-9][0-9]m@@g' /run/.bootlog
|
|
||||||
#Fix the time and hostname
|
|
||||||
BTIMESPEC=$(echo `date +"%b %d %T"` `hostname`)
|
|
||||||
sed -i "s@^bootlog:@${BTIMESPEC} bootlog:@" /run/.bootlog
|
|
||||||
# Don't try and write in 0 and 6, this is a 'boot' log
|
|
||||||
if [ "${runlevel}" != "0" -a "${runlevel}" != "6" ]; then
|
|
||||||
cat /run/.bootlog >> /var/log/boot.log
|
|
||||||
rm -f /run/.bootlog
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove interactive boot temp file
|
|
||||||
if [ -f /run/.interactive-start -a "${runlevel}" != "S" ]; then
|
|
||||||
rm -f /run/.interactive-start
|
|
||||||
fi
|
|
||||||
|
|
||||||
# End $RC_BASE/init.d/rc
|
|
@ -1,32 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Begin $RC_BASE/init.d/reboot
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: reboot
|
|
||||||
# Required-Start:
|
|
||||||
# Should-Start:
|
|
||||||
# Required-Stop:
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: 6
|
|
||||||
# Default-Stop:
|
|
||||||
# Short-Description: Reboots the system.
|
|
||||||
# Description: Reboots the System.
|
|
||||||
# X-LFS-Provided-By: LFS
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
stop)
|
|
||||||
log_success_msg "Restarting system..."
|
|
||||||
reboot -d -f -i
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Usage: ${0} {stop}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End $RC_BASE/init.d/reboot
|
|
@ -1,54 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Begin $RC_BASE/init.d/sendsignals
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: sendsignals
|
|
||||||
# Required-Start:
|
|
||||||
# Should-Start:
|
|
||||||
# Required-Stop: $local_fs swap localnet
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start:
|
|
||||||
# Default-Stop: 0 6
|
|
||||||
# Short-Description: Attempts to kill remaining processes.
|
|
||||||
# Description: Attempts to kill remaining processes.
|
|
||||||
# X-LFS-Provided-By: LFS
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
stop)
|
|
||||||
message="Sending all processes the TERM signal..."
|
|
||||||
killall5 -15
|
|
||||||
error_value=${?}
|
|
||||||
# Account for successful return value of 2
|
|
||||||
if [ ${error_value} -eq 2 ]; then
|
|
||||||
error_value=0
|
|
||||||
fi
|
|
||||||
sleep 3
|
|
||||||
|
|
||||||
(exit ${error_value})
|
|
||||||
evaluate_retval standard
|
|
||||||
|
|
||||||
message="Sending all processes the KILL signal..."
|
|
||||||
killall5 -9
|
|
||||||
error_value=${?}
|
|
||||||
# Account for successful return value of 2
|
|
||||||
if [ ${error_value} -eq 2 ]; then
|
|
||||||
error_value=0
|
|
||||||
fi
|
|
||||||
|
|
||||||
sleep 3
|
|
||||||
|
|
||||||
(exit ${error_value})
|
|
||||||
evaluate_retval standard
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Usage: ${0} {stop}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End $RC_BASE/init.d/sendsignals
|
|
@ -1,54 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Begin $RC_BASE/init.d/setclock
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: hwclock
|
|
||||||
# Required-Start:
|
|
||||||
# Should-Start: modules
|
|
||||||
# Required-Stop:
|
|
||||||
# Should-Stop: $syslog
|
|
||||||
# Default-Start:
|
|
||||||
# Default-Stop:
|
|
||||||
# Short-Description: Stores and restores time from the hardware clock
|
|
||||||
# Description: On boot, system time is obtained from hwclock. The
|
|
||||||
# hardware clock can also be set on shutdown.
|
|
||||||
# X-LFS-Provided-By: LFS BLFS
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
BIN_FILE="/sbin/hwclock"
|
|
||||||
|
|
||||||
chk_stat
|
|
||||||
|
|
||||||
case "${UTC}" in
|
|
||||||
yes|true|1)
|
|
||||||
CLOCKPARAMS="${CLOCKPARAMS} --utc"
|
|
||||||
;;
|
|
||||||
|
|
||||||
no|false|0)
|
|
||||||
CLOCKPARAMS="${CLOCKPARAMS} --localtime"
|
|
||||||
;;
|
|
||||||
|
|
||||||
esac
|
|
||||||
|
|
||||||
case ${1} in
|
|
||||||
start)
|
|
||||||
message="Setting system clock..."
|
|
||||||
${BIN_FILE} --hctosys ${CLOCKPARAMS} >/dev/null
|
|
||||||
evaluate_retval standard
|
|
||||||
;;
|
|
||||||
|
|
||||||
stop)
|
|
||||||
message="Setting hardware clock..."
|
|
||||||
${BIN_FILE} --systohc ${CLOCKPARAMS} >/dev/null
|
|
||||||
evaluate_retval standard
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Usage: ${0} {start|stop}"
|
|
||||||
;;
|
|
||||||
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End $RC_BASE/init.d/setclock
|
|
@ -1,55 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Begin $RC_BASE/init.d/swap
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: swap
|
|
||||||
# Required-Start: udev
|
|
||||||
# Should-Start: modules
|
|
||||||
# Required-Stop: localnet
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: S
|
|
||||||
# Default-Stop: 0 6
|
|
||||||
# Short-Description: Mounts and unmounts swap partitions.
|
|
||||||
# Description: Mounts and unmounts swap partitions defined in
|
|
||||||
# /etc/fstab.
|
|
||||||
# X-LFS-Provided-By: LFS
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
start)
|
|
||||||
message="Activating all swap files/partitions..."
|
|
||||||
swapon -a
|
|
||||||
evaluate_retval standard
|
|
||||||
;;
|
|
||||||
|
|
||||||
stop)
|
|
||||||
message="Deactivating all swap files/partitions..."
|
|
||||||
swapoff -a
|
|
||||||
evaluate_retval standard
|
|
||||||
;;
|
|
||||||
|
|
||||||
restart)
|
|
||||||
swapoff -a
|
|
||||||
error_level="${?}"
|
|
||||||
sleep 1
|
|
||||||
swapon -a
|
|
||||||
error_level="$(( ${error_level} + ${?} ))"
|
|
||||||
(exit "${error_level}")
|
|
||||||
evaluate_retval restart
|
|
||||||
;;
|
|
||||||
|
|
||||||
status)
|
|
||||||
log_success_msg "Retrieving swap status..."
|
|
||||||
echo
|
|
||||||
swapon -s
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Usage: ${0} {start|stop|restart|status}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End $RC_BASE/init.d/swap
|
|
@ -1,39 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Begin $RC_BASE/init.d/sysctl
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: sysctl
|
|
||||||
# Required-Start: mountvirtfs
|
|
||||||
# Should-Start:
|
|
||||||
# Required-Stop:
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: S
|
|
||||||
# Default-Stop:
|
|
||||||
# Short-Description: Makes changes to the proc filesystem
|
|
||||||
# Description: Makes changes to the proc filesystem as defined in
|
|
||||||
# /etc/sysctl.conf. See 'man sysctl(8)'.
|
|
||||||
# X-LFS-Provided-By: LFS
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
start)
|
|
||||||
if [ -f "/etc/sysctl.conf" ]; then
|
|
||||||
message="Setting kernel runtime parameters..."
|
|
||||||
sysctl -q -p
|
|
||||||
evaluate_retval standard
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
status)
|
|
||||||
sysctl -a
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Usage: ${0} {start|status}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End $RC_BASE/init.d/sysctl
|
|
@ -1,69 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Begin $RC_BASE/init.d/sysklogd
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: $syslog
|
|
||||||
# Required-Start: localnet
|
|
||||||
# Should-Start:
|
|
||||||
# Required-Stop: $local_fs sendsignals
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: 2 3 4 5
|
|
||||||
# Default-Stop: 0 1 6
|
|
||||||
# Short-Description: Starts kernel and system log daemons.
|
|
||||||
# Description: Starts kernel and system log daemons.
|
|
||||||
# /etc/fstab.
|
|
||||||
# X-LFS-Provided-By: LFS
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
start)
|
|
||||||
MESSAGE="system log daemon..."
|
|
||||||
start_daemon /sbin/syslogd -m 0
|
|
||||||
evaluate_retval start
|
|
||||||
|
|
||||||
MESSAGE="kernel log daemon..."
|
|
||||||
start_daemon /sbin/klogd
|
|
||||||
evaluate_retval start
|
|
||||||
;;
|
|
||||||
|
|
||||||
stop)
|
|
||||||
MESSAGE="kernel log daemon..."
|
|
||||||
killproc /sbin/klogd
|
|
||||||
evaluate_retval stop
|
|
||||||
|
|
||||||
MESSAGE="system log daemon..."
|
|
||||||
killproc /sbin/syslogd
|
|
||||||
evaluate_retval stop
|
|
||||||
;;
|
|
||||||
|
|
||||||
force-reload)
|
|
||||||
MESSAGE="system log daemon config file..."
|
|
||||||
killproc -HUP `/sbin/syslogd`
|
|
||||||
evaluate_retval reload
|
|
||||||
;;
|
|
||||||
|
|
||||||
restart)
|
|
||||||
MESSAGE="system and kernel log deamons..."
|
|
||||||
failed=0
|
|
||||||
killproc /sbin/klogd || failed=1
|
|
||||||
killproc /sbin/syslogd || failed=1
|
|
||||||
start_daemon /sbin/syslogd -m 0 || failed=1
|
|
||||||
start_daemon /sbin/klogd || failed=1
|
|
||||||
(exit ${failed})
|
|
||||||
evaluate_retval restart
|
|
||||||
;;
|
|
||||||
|
|
||||||
status)
|
|
||||||
statusproc /sbin/syslogd
|
|
||||||
statusproc /sbin/klogd
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Usage: ${0} {start|stop|force-reload|restart|status}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End $RC_BASE/init.d/sysklogd
|
|
@ -1,90 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Begin $RC_BASE/init.d/template
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: template
|
|
||||||
# Required-Start:
|
|
||||||
# Should-Start:
|
|
||||||
# Required-Stop:
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start:
|
|
||||||
# Default-Stop:
|
|
||||||
# Short-Description:
|
|
||||||
# Description:
|
|
||||||
# X-LFS-Provided-By:
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
# Source the LSB init-functions, ours are pulled in from there.
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
# These are optional, but required for chk_stat. They will be used in
|
|
||||||
# the rest of the functions if defined, else you must provide a program
|
|
||||||
# name to control, and a message ('Starting Template Service...'
|
|
||||||
# or 'Stoping Template Service...') to evauate_retval. See the
|
|
||||||
# documentaion in the lfs-fucntions file for more information.
|
|
||||||
MESSAGE="Template Service"
|
|
||||||
BIN_FILE="/some/path/to/template"
|
|
||||||
CONFIGFILE="/etc/default/template.conf"
|
|
||||||
|
|
||||||
# check that $BIN_FILE exists and is executable, and $CONFIGFILE exists.
|
|
||||||
chk_stat
|
|
||||||
|
|
||||||
# LSB Defined functions require that at least $BIN_FILE be passed to them,
|
|
||||||
# where as lfs-functions will use the $BIN_FILE environment variable.
|
|
||||||
# loadproc() and endproc() are just wrappers that pass everything on to
|
|
||||||
# the LSB defined functions.
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
start)
|
|
||||||
#start_daemon "${BIN_FILE}" -arg1 -arg2 #... or:
|
|
||||||
loadproc -arg1 -arg2 -arg3 #...
|
|
||||||
evaluate_retval start
|
|
||||||
;;
|
|
||||||
|
|
||||||
stop)
|
|
||||||
#killproc -TERM "${BIN_FILE}" or:
|
|
||||||
endproc
|
|
||||||
evaluate_retval stop
|
|
||||||
;;
|
|
||||||
|
|
||||||
force-reload)
|
|
||||||
reloadproc -force
|
|
||||||
evaluate_retval force-reload
|
|
||||||
;;
|
|
||||||
|
|
||||||
restart)
|
|
||||||
$0 stop
|
|
||||||
$0 start
|
|
||||||
;;
|
|
||||||
|
|
||||||
status)
|
|
||||||
statusproc
|
|
||||||
;;
|
|
||||||
|
|
||||||
# reload and try-restart are optional per LSB requirements
|
|
||||||
reload)
|
|
||||||
reloadproc
|
|
||||||
evaluate_retval reload
|
|
||||||
;;
|
|
||||||
|
|
||||||
try-restart)
|
|
||||||
# Since this is optional there is no lfs-function for this one...
|
|
||||||
# might be at a later time if used enough, but I doubt it usefullness.
|
|
||||||
pidofproc "${BIN_FILE}" > /dev/null
|
|
||||||
if [ "${?}" -ne "0" ]; then
|
|
||||||
MESSAGE="${MESSAGE}: Not Running"
|
|
||||||
else
|
|
||||||
$0 stop
|
|
||||||
$0 start
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
evaluate_retval try-restart
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Usage: ${0} {start|stop|{force-}reload|{try-}restart|status}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End $RC_BASE/init.d/template
|
|
@ -1,90 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Begin $RC_BASE/init.d/udev
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: udev
|
|
||||||
# Required-Start:
|
|
||||||
# Should-Start: modules
|
|
||||||
# Required-Stop:
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: S
|
|
||||||
# Default-Stop:
|
|
||||||
# Short-Description: Populated /dev with device nodes.
|
|
||||||
# Description: Mounts a tempfs on /dev and starts the udevd daemon.
|
|
||||||
# Device nodes are created as defined by udev.
|
|
||||||
# X-LFS-Provided-By: LFS
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
MESSAGE="Populating /dev with device nodes..."
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
start)
|
|
||||||
if ! grep -q '[[:space:]]sysfs' /proc/mounts; then
|
|
||||||
echo_failure
|
|
||||||
boot_mesg -n "FAILURE:\n\nUnable to create" ${FAILURE}
|
|
||||||
boot_mesg -n " devices without a SysFS filesystem"
|
|
||||||
boot_mesg -n "\n\nAfter you press Enter, this system"
|
|
||||||
boot_mesg -n " will be halted and powered off."
|
|
||||||
boot_mesg -n "\n\nPress Enter to continue..." ${INFO}
|
|
||||||
boot_mesg "" ${NORMAL}
|
|
||||||
$FAILURE_ACTION
|
|
||||||
/etc/rc.d/init.d/halt stop
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If not using DEVTMPFS mount a temporary file system over
|
|
||||||
# /dev, so that any devices made or removed during this boot
|
|
||||||
# don't affect the next one. The reason we don't write to mtab
|
|
||||||
# is because we don't ever want /dev to be unavailable (such as
|
|
||||||
# by `umount -a').
|
|
||||||
if ! mountpoint /dev > /dev/null; then
|
|
||||||
mount -n -t tmpfs tmpfs /dev -o mode=755
|
|
||||||
fi
|
|
||||||
if [ ${?} -ne 0 ]; then
|
|
||||||
echo_failure
|
|
||||||
boot_mesg -n "FAILURE:\n\nCannot mount a tmpfs" ${FAILURE}
|
|
||||||
boot_mesg -n " onto /dev, this system will be halted."
|
|
||||||
boot_mesg -n "\n\nAfter you press Enter, this system"
|
|
||||||
boot_mesg -n " will be halted and powered off."
|
|
||||||
boot_mesg -n "\n\nPress Enter to continue..." ${INFO}
|
|
||||||
boot_mesg "" ${NORMAL}
|
|
||||||
$FAILURE_ACTION
|
|
||||||
/etc/rc.d/init.d/halt stop
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create a symlink for POSIX shared memory
|
|
||||||
ln -s /run/shm /dev/shm
|
|
||||||
|
|
||||||
# Udev handles uevents itself, so we don't need to have
|
|
||||||
# the kernel call out to any binary in response to them
|
|
||||||
# This is a failsafe and should be done in kernel config
|
|
||||||
echo > /proc/sys/kernel/hotplug
|
|
||||||
|
|
||||||
# Copy the only static device node that Udev >= 155 doesn't
|
|
||||||
# handle to /dev (handled by default with DEVTMPFS)
|
|
||||||
if [ ! -f /dev/null ]; then
|
|
||||||
cp -a /lib/udev/devices/null /dev
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Start the udev daemon to continually watch for, and act on,
|
|
||||||
# uevents
|
|
||||||
/sbin/udevd --daemon
|
|
||||||
|
|
||||||
# Now traverse /sys in order to "coldplug" devices that have
|
|
||||||
# already been discovered
|
|
||||||
/sbin/udevadm trigger --action=add --type=subsystems
|
|
||||||
/sbin/udevadm trigger --action=add --type=devices
|
|
||||||
|
|
||||||
# Now wait for udevd to process the uevents we triggered
|
|
||||||
/sbin/udevadm settle
|
|
||||||
evaluate_retval standard
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Usage ${0} {start}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End $RC_BASE/init.d/udev
|
|
@ -1,49 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Begin $RC_BASE/init.d/udev_retry
|
|
||||||
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: udev_retry
|
|
||||||
# Required-Start: udev
|
|
||||||
# Should-Start: $local_fs
|
|
||||||
# Required-Stop:
|
|
||||||
# Should-Stop:
|
|
||||||
# Default-Start: S
|
|
||||||
# Default-Stop:
|
|
||||||
# Short-Description: Replays failed uevents and creates additonal devices.
|
|
||||||
# Description: Replays any failed uevents that were skipped due to
|
|
||||||
# slow hardware initialization, and creates those needed
|
|
||||||
# device nodes
|
|
||||||
# X-LFS-Provided-By: LFS
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
MESSAGE="Retrying failed uevents, if any..."
|
|
||||||
|
|
||||||
case "${1}" in
|
|
||||||
start)
|
|
||||||
|
|
||||||
# From Debian: "copy the rules generated before / was mounted
|
|
||||||
# read-write":
|
|
||||||
for file in /dev/.udev/tmp-rules--*; do
|
|
||||||
dest=${file##*tmp-rules--}
|
|
||||||
[ "$dest" = '*' ] && break
|
|
||||||
cat $file >> /etc/udev/rules.d/$dest
|
|
||||||
rm -f $file
|
|
||||||
done
|
|
||||||
|
|
||||||
# Re-trigger the failed uevents in hope they will succeed now
|
|
||||||
/sbin/udevadm trigger --type=failed --action=add
|
|
||||||
|
|
||||||
# Now wait for udevd to process the uevents we triggered
|
|
||||||
/sbin/udevadm settle
|
|
||||||
evaluate_retval standard
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Usage ${0} {start}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End $RC_BASE/init.d/udev_retry
|
|
@ -1,835 +0,0 @@
|
|||||||
# Begin /lib/lsb/init-funtions
|
|
||||||
|
|
||||||
# Provides initialization funtions as defined by the Linux Standard Base
|
|
||||||
# specification, version 3.1.0
|
|
||||||
|
|
||||||
# Source rc configuration if not inherited from the environment
|
|
||||||
if [ "${RC_BASE}" = "" ]; then
|
|
||||||
. /etc/default/rc
|
|
||||||
fi
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# start_daemon() #
|
|
||||||
# Usage: start_daemon [-f] [-n nicelevel] [-p pidfile] pathname [args...] #
|
|
||||||
# #
|
|
||||||
# Purpose: This runs the specified program as a daemon #
|
|
||||||
# #
|
|
||||||
# Inputs: -f: (force) run the program even if it is already running. #
|
|
||||||
# -n nicelevel: specify a nice level. See 'man nice(1)'. #
|
|
||||||
# -p pidfile: use the specified file to determine PIDs. #
|
|
||||||
# pathname: the complete path to the specified program #
|
|
||||||
# args: additional arguments passed to the program (pathname) #
|
|
||||||
# #
|
|
||||||
# Return values (as defined by LSB exit codes): #
|
|
||||||
# 0 - program is running or service is OK #
|
|
||||||
# 1 - generic or unspecified error #
|
|
||||||
# 2 - invalid or excessive argument(s) #
|
|
||||||
# 5 - program is not installed #
|
|
||||||
###############################################################################
|
|
||||||
start_daemon()
|
|
||||||
{
|
|
||||||
local force=""
|
|
||||||
local nice="0"
|
|
||||||
local pidfile=""
|
|
||||||
local pidlist=""
|
|
||||||
local retval=""
|
|
||||||
|
|
||||||
# Process arguments
|
|
||||||
while true
|
|
||||||
do
|
|
||||||
case "${1}" in
|
|
||||||
|
|
||||||
-f)
|
|
||||||
force="1"
|
|
||||||
shift 1
|
|
||||||
;;
|
|
||||||
|
|
||||||
-n)
|
|
||||||
nice="${2}"
|
|
||||||
shift 2
|
|
||||||
;;
|
|
||||||
|
|
||||||
-p)
|
|
||||||
pidfile="${2}"
|
|
||||||
shift 2
|
|
||||||
;;
|
|
||||||
|
|
||||||
-*)
|
|
||||||
return 2
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
program="${1}"
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# Check for a valid program
|
|
||||||
if [ ! -e "${program}" ]
|
|
||||||
then
|
|
||||||
return 5
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Execute
|
|
||||||
if [ -z "${force}" ]
|
|
||||||
then
|
|
||||||
if [ -z "${pidfile}" ]
|
|
||||||
then
|
|
||||||
# determine the pid by discovery
|
|
||||||
pidlist=`pidofproc "${1}"`
|
|
||||||
retval="${?}"
|
|
||||||
else
|
|
||||||
# The PID file contains the needed PIDs
|
|
||||||
# Note that by LSB requirement, the path must be given to pidofproc,
|
|
||||||
# however, it is not used by the current implementation or standard.
|
|
||||||
pidlist=`pidofproc -p "${pidfile}" "${1}"`
|
|
||||||
retval="${?}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# return a value ONLY
|
|
||||||
# It is the init script's (or distribution's functions) responsibilty
|
|
||||||
# to log messages!
|
|
||||||
case "${retval}" in
|
|
||||||
|
|
||||||
0)
|
|
||||||
# program is already running correctly, this is a
|
|
||||||
# succesful start.
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
|
|
||||||
1)
|
|
||||||
# program is not running, but an invalid pid file exists
|
|
||||||
# remove the pid file and continue
|
|
||||||
rm -f "${pidfile}"
|
|
||||||
;;
|
|
||||||
|
|
||||||
3)
|
|
||||||
# program is not running and no pidfile exists
|
|
||||||
# do nothing here, let start_deamon continue.
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
# Others as returned by status values shall not be interpreted
|
|
||||||
# and returned as an unspecified error.
|
|
||||||
return 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
# do the start!
|
|
||||||
nice -n "${nice}" "${@}"
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# killproc() #
|
|
||||||
# Usage: killproc [-p pidfile] pathname [signal] #
|
|
||||||
# #
|
|
||||||
# Purpose: Send control signals to running processes #
|
|
||||||
# #
|
|
||||||
# Inputs: -p pidfile, uses the specified pidfile #
|
|
||||||
# pathname, pathname to the specified program #
|
|
||||||
# signal, send this signal to pathname #
|
|
||||||
# #
|
|
||||||
# Return values (as defined by LSB exit codes): #
|
|
||||||
# 0 - program (pathname) has stopped/is already stopped or a #
|
|
||||||
# running program has been sent specified signal and stopped #
|
|
||||||
# successfully #
|
|
||||||
# 1 - generic or unspecified error #
|
|
||||||
# 2 - invalid or excessive argument(s) #
|
|
||||||
# 5 - program is not installed #
|
|
||||||
# 7 - program is not running and a signal was supplied #
|
|
||||||
###############################################################################
|
|
||||||
killproc()
|
|
||||||
{
|
|
||||||
local pidfile
|
|
||||||
local program
|
|
||||||
local prefix
|
|
||||||
local progname
|
|
||||||
local signal="-TERM"
|
|
||||||
local fallback="-KILL"
|
|
||||||
local nosig
|
|
||||||
local pidlist
|
|
||||||
local retval
|
|
||||||
local pid
|
|
||||||
local delay="30"
|
|
||||||
local piddead
|
|
||||||
local dtime
|
|
||||||
|
|
||||||
# Process arguments
|
|
||||||
while true
|
|
||||||
do
|
|
||||||
case "${1}" in
|
|
||||||
|
|
||||||
-p)
|
|
||||||
pidfile="${2}"
|
|
||||||
shift 2
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
program="${1}"
|
|
||||||
if [ -n "${2}" ]
|
|
||||||
then
|
|
||||||
signal="${2}"
|
|
||||||
fallback=""
|
|
||||||
else
|
|
||||||
nosig=1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# error on additional arguments
|
|
||||||
if [ -n "${3}" ]
|
|
||||||
then
|
|
||||||
return 2
|
|
||||||
else
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# Check for a valid program
|
|
||||||
if [ ! -e "${program}" ]
|
|
||||||
then
|
|
||||||
return 5
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check for a valid signal
|
|
||||||
check_signal "${signal}"
|
|
||||||
if [ "${?}" -ne "0" ]
|
|
||||||
then
|
|
||||||
return 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Get a list of pids
|
|
||||||
if [ -z "${pidfile}" ]
|
|
||||||
then
|
|
||||||
# determine the pid by discovery
|
|
||||||
pidlist=`pidofproc "${1}"`
|
|
||||||
retval="${?}"
|
|
||||||
else
|
|
||||||
# The PID file contains the needed PIDs
|
|
||||||
# Note that by LSB requirement, the path must be given to pidofproc,
|
|
||||||
# however, it is not used by the current implementation or standard.
|
|
||||||
pidlist=`pidofproc -p "${pidfile}" "${1}"`
|
|
||||||
retval="${?}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# return a value ONLY
|
|
||||||
# It is the init script's (or distribution's functions) responsibilty
|
|
||||||
# to log messages!
|
|
||||||
case "${retval}" in
|
|
||||||
|
|
||||||
0)
|
|
||||||
# program is running correctly
|
|
||||||
# do nothing here, let killproc continue.
|
|
||||||
;;
|
|
||||||
|
|
||||||
1)
|
|
||||||
# program is not running, but an invalid pid file exists
|
|
||||||
# remove the pid file.
|
|
||||||
rm -f "${pidfile}"
|
|
||||||
# this is only a success if no signal was passed.
|
|
||||||
if [ -n "${nosig}" ]
|
|
||||||
then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 7
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
3)
|
|
||||||
# program is not running and no pidfile exists
|
|
||||||
# this is only a success if no signal was passed.
|
|
||||||
if [ -n "${nosig}" ]
|
|
||||||
then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 7
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
# Others as returned by status values shall not be interpreted
|
|
||||||
# and returned as an unspecified error.
|
|
||||||
return 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# perform different actions for exit signals and control signals
|
|
||||||
check_sig_type "${signal}"
|
|
||||||
if [ "${?}" -eq "0" ] # signal is used to terminate the program
|
|
||||||
then
|
|
||||||
# account for empty pidlist (pid file still exists and nosignal was given)
|
|
||||||
if [ "${pidlist}" != "" ]; then
|
|
||||||
#kill the list of pids
|
|
||||||
for pid in ${pidlist}
|
|
||||||
do
|
|
||||||
kill -0 "${pid}" 2> /dev/null
|
|
||||||
if [ "${?}" -ne "0" ]; then
|
|
||||||
# process is dead, continue to next and assume all is well
|
|
||||||
continue
|
|
||||||
else
|
|
||||||
kill "${signal}" "${pid}" 2> /dev/null
|
|
||||||
# Wait up to ${delay}/10 seconds to for "${pid}" to
|
|
||||||
# terminate in 10ths of a second
|
|
||||||
while [ "${delay}" -ne "0" ]
|
|
||||||
do
|
|
||||||
kill -0 "${pid}" 2> /dev/null || piddead="1"
|
|
||||||
if [ "${piddead}" = "1" ]
|
|
||||||
then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
sleep 0.1
|
|
||||||
delay="$(( ${delay} - 1 ))"
|
|
||||||
done
|
|
||||||
# If a fallback is set, and program is still running, then
|
|
||||||
# use the fallback
|
|
||||||
if [ -n "${fallback}" -a "${piddead}" != "1" ]
|
|
||||||
then
|
|
||||||
kill "${fallback}" "${pid}" 2> /dev/null
|
|
||||||
sleep 1
|
|
||||||
# Check again, and fail if still running
|
|
||||||
kill -0 "${pid}" 2> /dev/null && return 1
|
|
||||||
else
|
|
||||||
# just check one last time and if still alive, fail
|
|
||||||
sleep 1
|
|
||||||
kill -0 "${pid}" 2> /dev/null && return 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check for and remove stale PID files.
|
|
||||||
if [ -z "${pidfile}" ]
|
|
||||||
then
|
|
||||||
#find the basename of $program
|
|
||||||
prefix=`echo "${program}" | sed 's/[^/]*$//'`
|
|
||||||
progname=`echo "${program}" | sed "s@${prefix}@@"`
|
|
||||||
if [ -e "/var/run/${progname}.pid" ]
|
|
||||||
then
|
|
||||||
rm -f "/var/run/${progname}.pid" 2> /dev/null
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
if [ -e "${pidfile}" ]
|
|
||||||
then
|
|
||||||
rm -f "${pidfile}" 2> /dev/null
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# For signals that do not expect a program to exit, simply
|
|
||||||
# let kill do it's job, and evaluate kills return for value
|
|
||||||
else # check_sig_type - signal is not used to terminate program
|
|
||||||
for pid in ${pidlist}
|
|
||||||
do
|
|
||||||
kill "${signal}" "${pid}"
|
|
||||||
if [ "${?}" -ne "0" ]; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# pidofproc() #
|
|
||||||
# Usage: pidofproc [-p pidfile] pathname #
|
|
||||||
# #
|
|
||||||
# Purpose: This function returns one or more pid(s) for a particular daemon #
|
|
||||||
# #
|
|
||||||
# Inputs: -p pidfile, use the specified pidfile instead of pidof #
|
|
||||||
# pathname, path to the specified program #
|
|
||||||
# #
|
|
||||||
# Return values (as defined by LSB status codes): #
|
|
||||||
# 0 - Success (PIDs to stdout) #
|
|
||||||
# 1 - Program is dead, PID file still exists (remaining PIDs output) #
|
|
||||||
# 3 - Program is not running (no output) #
|
|
||||||
###############################################################################
|
|
||||||
pidofproc()
|
|
||||||
{
|
|
||||||
|
|
||||||
local pidfile
|
|
||||||
local program
|
|
||||||
local prefix
|
|
||||||
local progname
|
|
||||||
local pidlist
|
|
||||||
local lpids
|
|
||||||
local exitstatus="0"
|
|
||||||
|
|
||||||
# Process arguments
|
|
||||||
while true
|
|
||||||
do
|
|
||||||
case "${1}" in
|
|
||||||
|
|
||||||
-p)
|
|
||||||
pidfile="${2}"
|
|
||||||
shift 2
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
program="${1}"
|
|
||||||
if [ -n "${2}" ]
|
|
||||||
then
|
|
||||||
# Too many arguments
|
|
||||||
# Since this is status, return unknown
|
|
||||||
return 4
|
|
||||||
else
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# If a PID file is not specified, try and find one.
|
|
||||||
if [ -z "${pidfile}" ]
|
|
||||||
then
|
|
||||||
# get the program's basename
|
|
||||||
prefix=`echo "${program}" | sed 's/[^/]*$//'`
|
|
||||||
progname=`echo "${program}" | sed "s@${prefix}@@"`
|
|
||||||
# if a PID file exists with that name, assume that is it.
|
|
||||||
if [ -e "/var/run/${progname}.pid" ]
|
|
||||||
then
|
|
||||||
pidfile="/var/run/${progname}.pid"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# if a PID file is set and exists, use it.
|
|
||||||
if [ -n "${pidfile}" -a -e "${pidfile}" ]
|
|
||||||
then
|
|
||||||
# use the value in the first line of the pidfile
|
|
||||||
pidlist=`/bin/head -n1 "${pidfile}"`
|
|
||||||
# This can optionally be written as 'sed 1q' to repalce 'head -n1'
|
|
||||||
# should LFS move /bin/head to /usr/bin/head
|
|
||||||
else
|
|
||||||
# use pidof
|
|
||||||
pidlist=`pidof "${program}"`
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Figure out if all listed PIDs are running.
|
|
||||||
for pid in ${pidlist}
|
|
||||||
do
|
|
||||||
kill -0 ${pid} 2> /dev/null
|
|
||||||
if [ "${?}" -eq "0" ]; then
|
|
||||||
lpids="${pids}${pid} "
|
|
||||||
else
|
|
||||||
exitstatus="1"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ -z "${lpids}" -a ! -f "${pidfile}" ]; then
|
|
||||||
return 3
|
|
||||||
else
|
|
||||||
echo "${lpids}"
|
|
||||||
return "${exitstatus}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# log_success_msg() #
|
|
||||||
# Usage: log_success_msg [$MESSAGE | "message"] #
|
|
||||||
# #
|
|
||||||
# Purpose: Print a successful status message to the screen and optionally #
|
|
||||||
# a boot log file. #
|
|
||||||
# #
|
|
||||||
# Inputs: accepts one string value, either a quoted string or optionally #
|
|
||||||
# the value of $MESSAGE if set in the running environment. #
|
|
||||||
# #
|
|
||||||
# Return values: Not used #
|
|
||||||
###############################################################################
|
|
||||||
log_success_msg()
|
|
||||||
{
|
|
||||||
echo -n -e "${PREFIX_SUCCESS}${@}"
|
|
||||||
echo -e "${SET_COL}${BRACKET}[${SUCCESS} OK ${BRACKET}]${NORMAL}"
|
|
||||||
if [ "${BOOTLOG_ENAB}" = "yes" ]; then
|
|
||||||
if [ $( hostname ) = "(none)" ]; then
|
|
||||||
BTTIMESPEC=""
|
|
||||||
else
|
|
||||||
BTTIMESPEC="$(echo `date -u +"%b %d %T"` `hostname`) "
|
|
||||||
fi
|
|
||||||
if [ "${RUNLEVEL}" != "0" -a "${RUNLEVEL}" != "6" ]; then
|
|
||||||
echo "${BTTIMESPEC}bootlog: ${@} Successful" >> /run/.bootlog
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# log_failure_msg() #
|
|
||||||
# Usage: log_failure_msg [$MESSAGE | "message"] #
|
|
||||||
# #
|
|
||||||
# Purpose: Print a failure status message to the screen and optionally #
|
|
||||||
# a boot log file. #
|
|
||||||
# #
|
|
||||||
# Inputs: accepts one string value, either a quoted string or optionally #
|
|
||||||
# the value of $MESSAGE if set in the running environment. #
|
|
||||||
# #
|
|
||||||
# Return values: Not used #
|
|
||||||
###############################################################################
|
|
||||||
log_failure_msg()
|
|
||||||
{
|
|
||||||
echo -n -e "${PREFIX_FAILURE}${@}"
|
|
||||||
echo -e "${SET_COL}${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"
|
|
||||||
if [ "${BOOTLOG_ENAB}" = "yes" ]; then
|
|
||||||
if [ $( hostname ) = "(none)" ]; then
|
|
||||||
BTTIMESPEC=""
|
|
||||||
else
|
|
||||||
BTTIMESPEC="$(echo `date -u +"%b %d %T"` `hostname`) "
|
|
||||||
fi
|
|
||||||
if [ "${RUNLEVEL}" != "0" -a "${RUNLEVEL}" != "6" ]; then
|
|
||||||
echo "${BTTIMESPEC}bootlog: ${@} Failed!" >> /run/.bootlog
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# log_warning_msg() #
|
|
||||||
# Usage: log_warning_msg [$MESSAGE | "message"] #
|
|
||||||
# #
|
|
||||||
# Purpose: Print a warning status message to the screen and optionally #
|
|
||||||
# a boot log file. #
|
|
||||||
# #
|
|
||||||
# Inputs: accepts one string value, either a quoted string or optionally #
|
|
||||||
# the value of $MESSAGE if set in the running environment. #
|
|
||||||
# #
|
|
||||||
# Return values: Not used #
|
|
||||||
###############################################################################
|
|
||||||
log_warning_msg()
|
|
||||||
{
|
|
||||||
echo -n -e "${PREFIX_WARNING}${@}"
|
|
||||||
echo -e "${SET_COL}${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}"
|
|
||||||
if [ "${BOOTLOG_ENAB}" = "yes" ]; then
|
|
||||||
if [ $( hostname ) = "(none)" ]; then
|
|
||||||
BTTIMESPEC=""
|
|
||||||
else
|
|
||||||
BTTIMESPEC="$(echo `date -u +"%b %d %T"` `hostname`) "
|
|
||||||
fi
|
|
||||||
if [ "${RUNLEVEL}" != "0" -a "${RUNLEVEL}" != "6" ]; then
|
|
||||||
echo "${BTTIMESPEC}bootlog: ${@} Warning" >> /run/.bootlog
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# The remaining fucntions are distro specific and are not defined by the LSB
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# check_signal() #
|
|
||||||
# Usage: check_signal [ -{signal} | {signal} ] #
|
|
||||||
# #
|
|
||||||
# Purpose: Check for a valid signal. This is not defined by any LSB draft, #
|
|
||||||
# however, it is required to check the signals to determine if the #
|
|
||||||
# signals chosen are invalid arguments to the other functions. #
|
|
||||||
# #
|
|
||||||
# Inputs: accepts a single string value in the form or -{signal} or {signal} #
|
|
||||||
# #
|
|
||||||
# Return values: #
|
|
||||||
# 0 - Success (signal is valid #
|
|
||||||
# 1 - Signal is not valid #
|
|
||||||
###############################################################################
|
|
||||||
check_signal()
|
|
||||||
{
|
|
||||||
local valsig
|
|
||||||
|
|
||||||
# Add error handling for invalid signals
|
|
||||||
valsig="-ALRM -HUP -INT -KILL -PIPE -POLL -PROF -TERM -USR1 -USR2"
|
|
||||||
valsig="${valsig} -VTALRM -STKFLT -PWR -WINCH -CHLD -URG -TSTP -TTIN"
|
|
||||||
valsig="${valsig} -TTOU -STOP -CONT -ABRT -FPE -ILL -QUIT -SEGV -TRAP"
|
|
||||||
valsig="${valsig} -SYS -EMT -BUS -XCPU -XFSZ -0 -1 -2 -3 -4 -5 -6 -8 -9"
|
|
||||||
valsig="${valsig} -11 -13 -14 -15"
|
|
||||||
|
|
||||||
echo "${valsig}" | grep -- " ${1} " > /dev/null
|
|
||||||
if [ "${?}" -eq "0" ]
|
|
||||||
then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# check_sig_type() #
|
|
||||||
# Usage: check_signal [ -{signal} | {signal} ] #
|
|
||||||
# #
|
|
||||||
# Purpose: Check if signal is a program termination signal or a control #
|
|
||||||
# signal. This is not defined by any LSB draft, however, it is #
|
|
||||||
# required to check the signals to determine if they are intended #
|
|
||||||
# to end a program or simply to control it. #
|
|
||||||
# #
|
|
||||||
# Inputs: accepts a single string value in the form or -{signal} or {signal} #
|
|
||||||
# #
|
|
||||||
# Return values: #
|
|
||||||
# 0 - Signal is used for program termination #
|
|
||||||
# 1 - Signal is used for program control #
|
|
||||||
###############################################################################
|
|
||||||
check_sig_type()
|
|
||||||
{
|
|
||||||
local valsig
|
|
||||||
|
|
||||||
# The list of termination signals (limited to generally used items)
|
|
||||||
valsig="-ALRM -INT -KILL -TERM -PWR -STOP -ABRT -QUIT -2 -3 -6 -9 -14 -15"
|
|
||||||
|
|
||||||
echo "${valsig}" | grep -- " ${1} " > /dev/null
|
|
||||||
if [ "${?}" -eq "0" ]
|
|
||||||
then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# chkstat() #
|
|
||||||
# Usage: chckstat BIN_FILE {CONFIG_FILE} #
|
|
||||||
# #
|
|
||||||
# Purpose: chk_stat checks the status of a script by checking for both a #
|
|
||||||
# binary file to execute, and if set, a config file that may be #
|
|
||||||
# needed for the program to run successfully. #
|
|
||||||
# #
|
|
||||||
# Inputs: accepts first argument of an executable file, and optionally a #
|
|
||||||
# second arugument of a configuration file. If BIN_FILE and #
|
|
||||||
# CONFIG_FILE are set in the calling environment, either or both #
|
|
||||||
# arguments may be omitted. #
|
|
||||||
# #
|
|
||||||
# Return values: #
|
|
||||||
# 0 - The executable, and optionally the configuration file exists #
|
|
||||||
# 2 - Invalid or excessive arguments #
|
|
||||||
# 5 - BIN_FILE does not exist #
|
|
||||||
# 6 - CONFIG_FILE (if set) does not exist #
|
|
||||||
###############################################################################
|
|
||||||
chk_stat()
|
|
||||||
{
|
|
||||||
if [ "${#}" -gt "0" -a "${#}" -lt "3" ]; then
|
|
||||||
BIN_FILE="${1}"
|
|
||||||
if [ -z "${2}" ]; then
|
|
||||||
CONFIG_FILE=""
|
|
||||||
else
|
|
||||||
CONFIG_FILE="${2}"
|
|
||||||
fi
|
|
||||||
elif [ -z "${BIN_FILE}" ]; then
|
|
||||||
echo "Usage: 'chk_stat BIN_FILE CONFIG_FILE'"
|
|
||||||
exit 1 # Generic Error
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -e "${BIN_FILE}" ]; then
|
|
||||||
log_failure_msg "${BIN_FILE} not installed" &&
|
|
||||||
exit 5
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -z "${CONFIG_FILE}" ]; then
|
|
||||||
if [ ! -e "${CONFIG_FILE}" ]; then
|
|
||||||
log_failure_msg "${CONFIG_FILE} does not exist" &&
|
|
||||||
exit 6
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# loadproc() #
|
|
||||||
# Usage: loadproc {arguments} #
|
|
||||||
# #
|
|
||||||
# Purpose: loadproc is just a wrapper to start_daemon for simple scripts, #
|
|
||||||
# which will require no aruguments if $BIN_FILE is set. #
|
|
||||||
# #
|
|
||||||
# Inputs: Any optional arguments passed to loadproc will be passed on to the #
|
|
||||||
# executable defined by $BIN_FILE. #
|
|
||||||
# #
|
|
||||||
# Return values: (none) #
|
|
||||||
###############################################################################
|
|
||||||
loadproc()
|
|
||||||
{
|
|
||||||
start_daemon "${BIN_FILE}" "${@}"
|
|
||||||
}
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# endproc() #
|
|
||||||
# Usage: endproc {arguments} #
|
|
||||||
# #
|
|
||||||
# Purpose: endproc is just a wrapper to killproc for simple scripts, which #
|
|
||||||
# which will require no aruguments if $BIN_FILE is set. #
|
|
||||||
# #
|
|
||||||
# Inputs: Any optional arguments passed to endproc will be passed on to the #
|
|
||||||
# executable defined by $BIN_FILE. #
|
|
||||||
# #
|
|
||||||
# Return values: (none) #
|
|
||||||
###############################################################################
|
|
||||||
endproc()
|
|
||||||
{
|
|
||||||
killproc "${BIN_FILE}" "${@}"
|
|
||||||
}
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# statusproc() #
|
|
||||||
# Usage: statusproc $BIN_FILE $MESSAGE #
|
|
||||||
# #
|
|
||||||
# Purpose: stautsproc is just a wrapper to pidofproc for simple scripts, #
|
|
||||||
# which will require no aruguments if $BIN_FILE and MESSAGE are set. #
|
|
||||||
# #
|
|
||||||
# Inputs: accepts first argument of an executable file, and a second message #
|
|
||||||
# arugument "MESSAGE" to be displayed. If BIN_FILE and MESSAGE are #
|
|
||||||
# set in the calling environment, both arguments may be omitted. #
|
|
||||||
# #
|
|
||||||
# Return values: exit values of pidofproc #
|
|
||||||
###############################################################################
|
|
||||||
statusproc()
|
|
||||||
{
|
|
||||||
if [ "${#}" -gt "0" -a "${#}" -lt "3" ]; then
|
|
||||||
BIN_FILE="${1}"
|
|
||||||
MESSAGE="${2}"
|
|
||||||
elif [ -z "${BIN_FILE}" -o -z "${MESSAGE}" ]; then
|
|
||||||
echo "Usage: 'statusproc BIN_FILE MESSAGE'"
|
|
||||||
exit 1 # Generic Error
|
|
||||||
fi
|
|
||||||
|
|
||||||
pidlist=`pidofproc "${BIN_FILE}"`
|
|
||||||
STATUS=$?
|
|
||||||
echo "Checking ${MESSAGE} status:"
|
|
||||||
if [ "${STATUS}" -eq "0" ]; then
|
|
||||||
log_success_msg "Running with PID(s) ${pidlist}"
|
|
||||||
else
|
|
||||||
log_warning_msg "Not running!"
|
|
||||||
fi
|
|
||||||
|
|
||||||
return "${STATUS}"
|
|
||||||
}
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# reloadproc() #
|
|
||||||
# Usage: reloadproc {--force} $BIN_FILE $MESSAGE #
|
|
||||||
# #
|
|
||||||
# Purpose: reloadproc sends a HUP signal to the running program (relaod #
|
|
||||||
# configuration). It optionally, using the -force switch, checks the #
|
|
||||||
# status of a particular program and starts it if it is not already #
|
|
||||||
# running. #
|
|
||||||
# #
|
|
||||||
# Inputs: accepts one optional switch (must be the first argument), and #
|
|
||||||
# either two, or zero string arguments. If BIN_FILE and MESSAGE are #
|
|
||||||
# set in the calling envirnoment it will use those values, else it #
|
|
||||||
# requires the bin file as the first argument (following -force if #
|
|
||||||
# used), and the message as the second. If the --force argument is #
|
|
||||||
# given, it follows the LSB definition of 'force-reload' - the #
|
|
||||||
# program is started if not already running. #
|
|
||||||
# #
|
|
||||||
# Return values: 1 - generic error #
|
|
||||||
###############################################################################
|
|
||||||
reloadproc()
|
|
||||||
{
|
|
||||||
local force="0"
|
|
||||||
if [ "${#}" -gt "0" -a "${1}" = "-force" ]; then
|
|
||||||
force="1"
|
|
||||||
shift 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${#}" -gt "0" -a "${#}" -lt "3" ]; then
|
|
||||||
BIN_FILE="${1}"
|
|
||||||
MESSAGE="${2}"
|
|
||||||
elif [ -z "${BIN_FILE}" -o -z "${MESSAGE}" ]; then
|
|
||||||
echo "Usage: 'reloadproc BIN_FILE MESSAGE'"
|
|
||||||
exit 1 # Generic Error
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
###############################################################################
|
|
||||||
# evaluate_retval() #
|
|
||||||
# Usage: evaluate_retval \ #
|
|
||||||
# [standard|start|stop|reload|force-reload|restart|try-restart] #
|
|
||||||
# #
|
|
||||||
# Purpose: determines the sucess or failure of a previous command based on #
|
|
||||||
# LSB exit values, and prints messages to the screen using the #
|
|
||||||
# log_*_msg() functions. #
|
|
||||||
# #
|
|
||||||
# Inputs: accepts one argument which determines the output of the message #
|
|
||||||
# displayed on the screen based on the LSB input values for init #
|
|
||||||
# scripts. The 'standard' argument makes no changes to the value of #
|
|
||||||
# $message or $MESSAGE, but only one can be set in the calling #
|
|
||||||
# environment. #
|
|
||||||
# #
|
|
||||||
# Return values: (none) #
|
|
||||||
###############################################################################
|
|
||||||
evaluate_retval()
|
|
||||||
{
|
|
||||||
local error_value="${?}"
|
|
||||||
|
|
||||||
# Handle LSB defined return values
|
|
||||||
case "${1}" in
|
|
||||||
|
|
||||||
start)
|
|
||||||
case "${error_value}" in
|
|
||||||
0)
|
|
||||||
log_success_msg "Starting ${MESSAGE} "
|
|
||||||
return "${error_value}"
|
|
||||||
;;
|
|
||||||
2)
|
|
||||||
log_failure_msg "Starting ${MESSAGE} Error: Invalid argument!"
|
|
||||||
return "${error_value}"
|
|
||||||
;;
|
|
||||||
5)
|
|
||||||
log_failure_msg "Starting ${MESSAGE} Error: Not available!"
|
|
||||||
return "${error_value}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
log_failure_msg "Starting ${MESSAGE} Error: General failure!"
|
|
||||||
return "${error_value}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
|
|
||||||
stop)
|
|
||||||
case "${error_value}" in
|
|
||||||
0)
|
|
||||||
log_success_msg "Stopping ${MESSAGE} "
|
|
||||||
return "${error_value}"
|
|
||||||
;;
|
|
||||||
2)
|
|
||||||
log_failure_msg "Stopping ${MESSAGE} Error: Invalid argument!"
|
|
||||||
return "${error_value}"
|
|
||||||
;;
|
|
||||||
5)
|
|
||||||
log_failure_msg "Stopping ${MESSAGE} Error: Not available!"
|
|
||||||
return "${error_value}"
|
|
||||||
;;
|
|
||||||
7)
|
|
||||||
log_warning_msg "Stopping ${MESSAGE} Warning: Not running!"
|
|
||||||
return "${error_value}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
log_failure_msg "Stopping ${MESSAGE} Error: General failure!"
|
|
||||||
return "${error_value}"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
|
|
||||||
force-reload)
|
|
||||||
message="Forcefully reloading "
|
|
||||||
;;
|
|
||||||
|
|
||||||
reload)
|
|
||||||
message="Reloading "
|
|
||||||
;;
|
|
||||||
|
|
||||||
restart)
|
|
||||||
message="Restarting "
|
|
||||||
;;
|
|
||||||
|
|
||||||
try-restart)
|
|
||||||
message="Trying restart "
|
|
||||||
;;
|
|
||||||
|
|
||||||
standard)
|
|
||||||
# $message or $MESSAGE must be set, but not both in order
|
|
||||||
# to use the 'standard' target.
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# Print messages for the generic force-reload, reload, restart,
|
|
||||||
# and try-restart targets
|
|
||||||
if [ "${error_value}" -eq "0" ]
|
|
||||||
then
|
|
||||||
log_success_msg "${message}${MESSAGE} "
|
|
||||||
return "${error_value}"
|
|
||||||
else
|
|
||||||
log_failure_msg "${message}${MESSAGE} "
|
|
||||||
return "${error_value}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# End /lib/lsb/init-functions
|
|
@ -1,80 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
########################################################################
|
|
||||||
# Begin /lib/network-services/ipv4-static
|
|
||||||
#
|
|
||||||
# Description : IPV4 Static Boot Script
|
|
||||||
#
|
|
||||||
# Authors : Nathan Coulson - nathan@linuxfromscratch.org
|
|
||||||
# Kevin P. Fleming - kpfleming@linuxfromscratch.org
|
|
||||||
#
|
|
||||||
# Version : 00.00
|
|
||||||
#
|
|
||||||
# Notes :
|
|
||||||
#
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
. ${IFCONFIG}
|
|
||||||
|
|
||||||
if [ -z "${IP}" ]; then
|
|
||||||
log_failure_msg "IP variable missing from ${IFCONFIG}, cannot continue."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "${PREFIX}" -a -z "${PEER}" ]; then
|
|
||||||
log_warning_msg "PREFIX variable missing from ${IFCONFIG}, assuming 24."
|
|
||||||
PREFIX=24
|
|
||||||
args="${args} ${IP}/${PREFIX}"
|
|
||||||
elif [ -n "${PREFIX}" -a -n "${PEER}" ]; then
|
|
||||||
log_failure_msg "PREFIX and PEER both specified in ${IFCONFIG}, cannot continue."
|
|
||||||
exit 1
|
|
||||||
elif [ -n "${PREFIX}" ]; then
|
|
||||||
args="${args} ${IP}/${PREFIX}"
|
|
||||||
elif [ -n "${PEER}" ]; then
|
|
||||||
args="${args} ${IP} peer ${PEER}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${BROADCAST}" ]; then
|
|
||||||
args="${args} broadcast ${BROADCAST}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${SOURCE}" ]; then
|
|
||||||
args="${args} src ${SOURCE}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "${2}" in
|
|
||||||
up)
|
|
||||||
MESSAGE="Adding IPv4 address ${IP} to the ${1} interface..."
|
|
||||||
ip addr add ${args} dev ${1}
|
|
||||||
evaluate_retval
|
|
||||||
|
|
||||||
if [ -n "${GATEWAY}" ]; then
|
|
||||||
if ip route | grep -q default; then
|
|
||||||
log_warning_msg "Gateway already setup; skipping." ${WARNING}
|
|
||||||
else
|
|
||||||
MESSAGE="Setting up default gateway..."
|
|
||||||
ip route add default via ${GATEWAY} dev ${1}
|
|
||||||
evaluate_retval
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
|
|
||||||
down)
|
|
||||||
if [ -n "${GATEWAY}" ]; then
|
|
||||||
MESSAGE="Removing default gateway..."
|
|
||||||
ip route del default
|
|
||||||
evaluate_retval
|
|
||||||
fi
|
|
||||||
|
|
||||||
MESSAGE="Removing IPv4 address ${IP} from the ${1} interface..."
|
|
||||||
ip addr del ${args} dev ${1}
|
|
||||||
evaluate_retval
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Usage: ${0} [interface] {up|down}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End /lib/network-services/ipv4-static
|
|
@ -1,92 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
########################################################################
|
|
||||||
# Begin /lib/network-services/ipv4-static-route
|
|
||||||
#
|
|
||||||
# Description : IPV4 Static Route Script
|
|
||||||
#
|
|
||||||
# Authors : Kevin P. Fleming - kpfleming@linuxfromscratch.org
|
|
||||||
#
|
|
||||||
# Version : 00.00
|
|
||||||
#
|
|
||||||
# Notes :
|
|
||||||
#
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
. ${IFCONFIG}
|
|
||||||
|
|
||||||
case "${TYPE}" in
|
|
||||||
("" | "network")
|
|
||||||
need_ip=1
|
|
||||||
need_gateway=1
|
|
||||||
;;
|
|
||||||
|
|
||||||
("default")
|
|
||||||
need_gateway=1
|
|
||||||
args="${args} default"
|
|
||||||
desc="default"
|
|
||||||
;;
|
|
||||||
|
|
||||||
("host")
|
|
||||||
need_ip=1
|
|
||||||
;;
|
|
||||||
|
|
||||||
("unreachable")
|
|
||||||
need_ip=1
|
|
||||||
args="${args} unreachable"
|
|
||||||
desc="unreachable "
|
|
||||||
;;
|
|
||||||
|
|
||||||
(*)
|
|
||||||
boot_mesg "Unknown route type (${TYPE}) in ${IFCONFIG}, cannot continue." ${FAILURE}
|
|
||||||
echo_failure
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -n "${need_ip}" ]; then
|
|
||||||
if [ -z "${IP}" ]; then
|
|
||||||
boot_mesg "IP variable missing from ${IFCONFIG}, cannot continue." ${FAILURE}
|
|
||||||
echo_failure
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "${PREFIX}" ]; then
|
|
||||||
boot_mesg "PREFIX variable missing from ${IFCONFIG}, cannot continue." ${FAILURE}
|
|
||||||
echo_failure
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
args="${args} ${IP}/${PREFIX}"
|
|
||||||
desc="${desc}${IP}/${PREFIX}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "${need_gateway}" ]; then
|
|
||||||
if [ -z "${GATEWAY}" ]; then
|
|
||||||
boot_mesg "GATEWAY variable missing from ${IFCONFIG}, cannot continue." ${FAILURE}
|
|
||||||
echo_failure
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
args="${args} via ${GATEWAY}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "${2}" in
|
|
||||||
up)
|
|
||||||
boot_mesg "Adding '${desc}' route to the ${1} interface..."
|
|
||||||
ip route add ${args} dev ${1}
|
|
||||||
evaluate_retval
|
|
||||||
;;
|
|
||||||
|
|
||||||
down)
|
|
||||||
boot_mesg "Removing '${desc}' route from the ${1} interface..."
|
|
||||||
ip route del ${args} dev ${1}
|
|
||||||
evaluate_retval
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
|
||||||
echo "Usage: ${0} [interface] {up|down}"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# End /lib/network-services/ipv4-static-route
|
|
@ -1,176 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
########################################################################
|
|
||||||
# Begin /sbin/ifdown
|
|
||||||
#
|
|
||||||
# Description : Interface Down
|
|
||||||
#
|
|
||||||
# Authors : DJ Lucas - dj@linuxfromscratch.org
|
|
||||||
#
|
|
||||||
# Version : 00.02
|
|
||||||
#
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
function get_args()
|
|
||||||
{
|
|
||||||
if test -z "${1}" ; then
|
|
||||||
showhelp
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
while test -n "${1}" ; do
|
|
||||||
case "${1}" in
|
|
||||||
-c | --configfile)
|
|
||||||
check_arg $1 $2
|
|
||||||
CONFIGFILE="${2}"
|
|
||||||
shift 2
|
|
||||||
;;
|
|
||||||
-f | --force)
|
|
||||||
FORCE="1"
|
|
||||||
shift 1
|
|
||||||
;;
|
|
||||||
eth* | iw* | wlan*)
|
|
||||||
INTERFACE="${1}"
|
|
||||||
shift 1
|
|
||||||
;;
|
|
||||||
-h | --help)
|
|
||||||
showhelp
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
showhelp
|
|
||||||
echo "ERROR: '${1}' unknown argument"
|
|
||||||
echo ""
|
|
||||||
exit 2
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
function check_arg()
|
|
||||||
{
|
|
||||||
echo "${2}" | grep -v "^-" > /dev/null
|
|
||||||
if [ -z "${?}" -o ! -n "${2}" ]; then
|
|
||||||
echo "Error: ${1} requires a valid argument."
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function showhelp()
|
|
||||||
{
|
|
||||||
echo ""
|
|
||||||
echo "`/usr/bin/basename ${0}` brings down a valid network interface."
|
|
||||||
echo ""
|
|
||||||
echo "Options:"
|
|
||||||
echo " -c --configfile The path to an interface configuration file"
|
|
||||||
echo " If no configuration file is given, all files"
|
|
||||||
echo " listed in /etc/network/ifconfig.<int> will"
|
|
||||||
echo " be processed, regarless of the value of ONBOOT"
|
|
||||||
echo " -f --force Flush all IPs and force the interface down."
|
|
||||||
echo " -h --help Show this help message and exit."
|
|
||||||
echo ""
|
|
||||||
echo "Examples:"
|
|
||||||
echo " `/usr/bin/basename ${0}` eth0 -c /run/network/ifconfig.eth0/ipv4"
|
|
||||||
echo " `/usr/bin/basename ${0}` eth0 --force -c /run/network/ifconfig.eth0/ipv4"
|
|
||||||
echo " `/usr/bin/basename ${0}` eth0 --force"
|
|
||||||
echo " `/usr/bin/basename ${0}` eth0"
|
|
||||||
echo ""
|
|
||||||
echo ""
|
|
||||||
}
|
|
||||||
|
|
||||||
# Intialize empty variables so that the shell does not polute the script
|
|
||||||
CONFIGFILE=""
|
|
||||||
CONFIGDIR=""
|
|
||||||
INTERFACE=""
|
|
||||||
FORCE=""
|
|
||||||
failed=0
|
|
||||||
|
|
||||||
# Process command line arguments
|
|
||||||
get_args ${@}
|
|
||||||
|
|
||||||
# Handle common errors - No need to account for bootscripts, this should not
|
|
||||||
# happen during boot or shutdown.
|
|
||||||
if [ "${CONFIGFILE}x" != "x" -a ! -f "${CONFIGFILE}" ]; then
|
|
||||||
echo "ERROR: ${CONFIGFILE} is not a valid network configuration file."
|
|
||||||
echo ""
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${INTERFACE}x" == "x" ]; then
|
|
||||||
echo "ERROR: No interface was given"
|
|
||||||
echo ""
|
|
||||||
exit 2
|
|
||||||
else
|
|
||||||
if ! grep "${INTERFACE}" /proc/net/dev 2>&1 > /dev/null; then
|
|
||||||
echo "ERROR: ${INTERFACE} is not a valid network interface."
|
|
||||||
echo ""
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If a configuration file is present, use it
|
|
||||||
if [ "${CONFIGFILE}x" != "x" ]; then
|
|
||||||
. "${CONFIGFILE}"
|
|
||||||
if [ -x "/lib/network-services/${SERVICE}" ]; then
|
|
||||||
# do the work
|
|
||||||
if IFCONFIG=${CONFIGFILE} \
|
|
||||||
/lib/network-services/${SERVICE} ${INTERFACE} down; then
|
|
||||||
rm "${CONFIGFILE}"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "ERROR: Service '${SERVICE}' is not a valid service."
|
|
||||||
echo ""
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
# No interface configuration file was given
|
|
||||||
else
|
|
||||||
# Process all running interface configuration files
|
|
||||||
CONFIGDIR="/run/network/ifconfig.${INTERFACE}"
|
|
||||||
if [ -d "${CONFIGDIR}" ]; then
|
|
||||||
FILES=`ls "${CONFIGDIR}"`
|
|
||||||
for CONFIGFILE in ${FILES}
|
|
||||||
do
|
|
||||||
(
|
|
||||||
. "${CONFIGDIR}/${CONFIGFILE}"
|
|
||||||
# No error checking necessary if they are in /run
|
|
||||||
if IFCONFIG="${CONFIGDIR}/${CONFIGFILE}" \
|
|
||||||
/lib/network-services/${SERVICE} ${INTERFACE} down; then
|
|
||||||
rm "${CONFIGDIR}/${CONFIGFILE}"
|
|
||||||
fi
|
|
||||||
)
|
|
||||||
done
|
|
||||||
# all running config files processes, set the link down
|
|
||||||
message="Setting interface ${INTERFACE} down..."
|
|
||||||
/sbin/ip link set "${INTERFACE}" down
|
|
||||||
evaluate_retval standard
|
|
||||||
else
|
|
||||||
if [ "${FORCE}" != "1" ]; then
|
|
||||||
echo "ERROR: No configuration files found for ${INTERFACE}."
|
|
||||||
echo ""
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${FORCE}" == "1" ]; then
|
|
||||||
/sbin/ip addr flush dev "${INTERFACE}" 2>&1 > /dev/null || failed=1
|
|
||||||
if [ "${failed}" == "1" ]; then
|
|
||||||
log_failure_msg "Flushing IP addresses from interface ${INTERFACE}..."
|
|
||||||
echo ""
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
log_success_msg "Flushing IP addresses from interface ${INTERFACE}..."
|
|
||||||
fi
|
|
||||||
/sbin/ip link set dev "${INTERFACE}" down 2>&1 > /dev/null || failed=1
|
|
||||||
if [ "${failed}" == "1" ]; then
|
|
||||||
log_failure_msg "Setting link down for interface ${INTERFACE}..."
|
|
||||||
echo ""
|
|
||||||
exit 1
|
|
||||||
else
|
|
||||||
log_success_msg "Setting link down for interface ${INTERFACE}..."
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit "${failed}"
|
|
||||||
|
|
@ -1,160 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
########################################################################
|
|
||||||
# Begin /sbin/ifdown
|
|
||||||
#
|
|
||||||
# Description : Interface Up
|
|
||||||
#
|
|
||||||
# Authors : DJ Lucas - dj@linuxfromscratch.org
|
|
||||||
#
|
|
||||||
# Version : 00.02
|
|
||||||
#
|
|
||||||
########################################################################
|
|
||||||
|
|
||||||
. /lib/lsb/init-functions
|
|
||||||
|
|
||||||
function get_args()
|
|
||||||
{
|
|
||||||
if test -z "${1}" ; then
|
|
||||||
showhelp
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
while test -n "${1}" ; do
|
|
||||||
case "${1}" in
|
|
||||||
-c | --configfile)
|
|
||||||
check_arg $1 $2
|
|
||||||
CONFIGFILE="${2}"
|
|
||||||
shift 2
|
|
||||||
;;
|
|
||||||
eth* | iw* | wlan*)
|
|
||||||
INTERFACE="${1}"
|
|
||||||
shift 1
|
|
||||||
;;
|
|
||||||
-h | --help)
|
|
||||||
showhelp
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
showhelp
|
|
||||||
echo "ERROR: '${1}' unknown argument"
|
|
||||||
echo ""
|
|
||||||
exit 2
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
function check_arg()
|
|
||||||
{
|
|
||||||
echo "${2}" | grep -v "^-" > /dev/null
|
|
||||||
if [ -z "${?}" -o ! -n "${2}" ]; then
|
|
||||||
echo "Error: ${1} requires a valid argument."
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function showhelp()
|
|
||||||
{
|
|
||||||
echo "`/usr/bin/basename ${0}` brings up a valid network interface."
|
|
||||||
echo ""
|
|
||||||
echo "Options:"
|
|
||||||
echo " -c --configfile The path to an interface configuration file"
|
|
||||||
echo " If no configuration file is given, all files"
|
|
||||||
echo " listed in ${NETWORK_DEVICES}/ifconfig.<int> will"
|
|
||||||
echo " be processed, regarless of the value of ONBOOT"
|
|
||||||
echo " -h --help Show this help message and exit."
|
|
||||||
echo ""
|
|
||||||
echo "Examples:"
|
|
||||||
echo " `/usr/bin/basename ${0}` eth0 -c ${NETWORK_DEVICES}/ifconfig.eth0/ipv4"
|
|
||||||
echo " `/usr/bin/basename ${0}` eth0"
|
|
||||||
echo ""
|
|
||||||
echo ""
|
|
||||||
}
|
|
||||||
|
|
||||||
# Intialize empty variables so that the shell does not polute the script
|
|
||||||
CONFIGFILE=""
|
|
||||||
CONFIGDIR=""
|
|
||||||
INTERFACE=""
|
|
||||||
|
|
||||||
# Process command line arguments
|
|
||||||
get_args ${@}
|
|
||||||
|
|
||||||
# Handle common errors - No need to account for bootscripts, this should not
|
|
||||||
# happen during boot or shutdown.
|
|
||||||
if [ "${CONFIGFILE}x" != "x" -a ! -f "${CONFIGFILE}" ]; then
|
|
||||||
echo "ERROR: ${CONFIGFILE} is not a valid network configuration file."
|
|
||||||
echo ""
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${INTERFACE}x" == "x" ]; then
|
|
||||||
echo "ERROR: No interface was given"
|
|
||||||
echo ""
|
|
||||||
exit 2
|
|
||||||
else
|
|
||||||
if ! grep "${INTERFACE}" /proc/net/dev 2>&1 > /dev/null; then
|
|
||||||
echo "ERROR: ${INTERFACE} is not a valid network interface."
|
|
||||||
echo ""
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If a configuration file is present, use it
|
|
||||||
if [ "${CONFIGFILE}x" != "x" ]; then
|
|
||||||
. "${CONFIGFILE}"
|
|
||||||
if [ -x "/lib/network-services/${SERVICE}" ]; then
|
|
||||||
# do the work
|
|
||||||
# Check to make sure the interface is up
|
|
||||||
link_status=`/sbin/ip link show "${INTERFACE}" | \
|
|
||||||
grep -o "state UP"`
|
|
||||||
if [ "${link_status}" != "state UP" ]; then
|
|
||||||
message="Bringing up the ${INTERFACE} interface..."
|
|
||||||
/sbin/ip link set ${INTERFACE} up
|
|
||||||
evaluate_retval standard
|
|
||||||
fi
|
|
||||||
if IFCONFIG=${CONFIGFILE} \
|
|
||||||
/lib/network-services/${SERVICE} ${INTERFACE} up; then
|
|
||||||
mkdir -p "/run/network/ifconfig.${INTERFACE}"
|
|
||||||
cp "${CONFIGFILE}" "/run/network/ifconfig.${INTERFACE}/"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "ERROR: Service '${SERVICE}' is not a valid service."
|
|
||||||
echo ""
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
# No interface configuration file was given
|
|
||||||
else
|
|
||||||
# Process all available interface configuration files
|
|
||||||
CONFIGDIR="/etc/network/ifconfig.${INTERFACE}"
|
|
||||||
if [ -d "${CONFIGDIR}" ]; then
|
|
||||||
FILES=`ls "${CONFIGDIR}"`
|
|
||||||
for CONFIGFILE in ${FILES}
|
|
||||||
do
|
|
||||||
(
|
|
||||||
. "${CONFIGDIR}/${CONFIGFILE}"
|
|
||||||
if [ -x "/lib/network-services/${SERVICE}" ]; then
|
|
||||||
# Check to make sure the interface is up
|
|
||||||
link_status=`/sbin/ip link show "${INTERFACE}" | \
|
|
||||||
grep -o "state UP"`
|
|
||||||
if [ "${link_status}" != "state UP" ]; then
|
|
||||||
message="Bringing up the ${INTERFACE} interface..."
|
|
||||||
/sbin/ip link set ${INTERFACE} up
|
|
||||||
evaluate_retval standard
|
|
||||||
fi
|
|
||||||
if IFCONFIG="${CONFIGDIR}/${CONFIGFILE}" \
|
|
||||||
/lib/network-services/${SERVICE} ${INTERFACE} up; then
|
|
||||||
mkdir -p "/run/network/ifconfig.${INTERFACE}"
|
|
||||||
cp "${CONFIGDIR}/${CONFIGFILE}" \
|
|
||||||
"/run/network/ifconfig.${INTERFACE}/"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "ERROR: Service '${SERVICE}' is not a valid service."
|
|
||||||
echo ""
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
)
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
@ -302,7 +302,7 @@
|
|||||||
<!ENTITY less-ch6-du "3.8 MB">
|
<!ENTITY less-ch6-du "3.8 MB">
|
||||||
<!ENTITY less-ch6-sbu "less than 0.1 SBU">
|
<!ENTITY less-ch6-sbu "less than 0.1 SBU">
|
||||||
|
|
||||||
<!ENTITY lfs-bootscripts-version "20120823"> <!-- Scripts depend on this format -->
|
<!ENTITY lfs-bootscripts-version "20120829"> <!-- Scripts depend on this format -->
|
||||||
<!ENTITY lfs-bootscripts-size "BOOTSCRIPTS-SIZE KB"> <!-- Updated in Makefile -->
|
<!ENTITY lfs-bootscripts-size "BOOTSCRIPTS-SIZE KB"> <!-- Updated in Makefile -->
|
||||||
<!ENTITY lfs-bootscripts-url "&downloads-root;lfs-bootscripts-&lfs-bootscripts-version;.tar.bz2">
|
<!ENTITY lfs-bootscripts-url "&downloads-root;lfs-bootscripts-&lfs-bootscripts-version;.tar.bz2">
|
||||||
<!ENTITY lfs-bootscripts-md5 "BOOTSCRIPTS-MD5SUM"> <!-- Updated in Makefile -->
|
<!ENTITY lfs-bootscripts-md5 "BOOTSCRIPTS-MD5SUM"> <!-- Updated in Makefile -->
|
||||||
|
@ -27,7 +27,7 @@ $Date$
|
|||||||
We create this param to can have gentext support in both
|
We create this param to can have gentext support in both
|
||||||
the Index page title and links that point to the Index page.
|
the Index page title and links that point to the Index page.
|
||||||
It also allow us to change the title, if wanted.
|
It also allow us to change the title, if wanted.
|
||||||
Note: To change the title involves creating the appropiate
|
Note: To change the title involves creating the appropriate
|
||||||
entries in lfs-l10n.xml -->
|
entries in lfs-l10n.xml -->
|
||||||
<xsl:param name="index-title">Index</xsl:param>
|
<xsl:param name="index-title">Index</xsl:param>
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ advertising or otherwise to promote the sale, use or other
|
|||||||
dealings in this Software without prior written authorization
|
dealings in this Software without prior written authorization
|
||||||
from the individuals in question.
|
from the individuals in question.
|
||||||
|
|
||||||
Any stylesheet derived from this Software that is publically
|
Any stylesheet derived from this Software that is publicly
|
||||||
distributed will be identified with a different name and the
|
distributed will be identified with a different name and the
|
||||||
version strings in any derived Software will be changed so that
|
version strings in any derived Software will be changed so that
|
||||||
no possibility of confusion between the derived package and this
|
no possibility of confusion between the derived package and this
|
||||||
|
@ -832,7 +832,7 @@ set toc,title
|
|||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:param>
|
</xsl:param>
|
||||||
<xsl:param name="toc.indent.width">24</xsl:param>
|
<xsl:param name="toc.indent.width">24</xsl:param>
|
||||||
<!-- inconsistant point specification? -->
|
<!-- inconsistent point specification? -->
|
||||||
<xsl:attribute-set name="toc.line.properties">
|
<xsl:attribute-set name="toc.line.properties">
|
||||||
<xsl:attribute name="text-align-last">justify</xsl:attribute>
|
<xsl:attribute name="text-align-last">justify</xsl:attribute>
|
||||||
<xsl:attribute name="text-align">start</xsl:attribute>
|
<xsl:attribute name="text-align">start</xsl:attribute>
|
||||||
|
@ -107,7 +107,7 @@
|
|||||||
and convert percentages to actual values based on that nominal size.
|
and convert percentages to actual values based on that nominal size.
|
||||||
|
|
||||||
Scale can be problematic. Scale applies to the contentwidth, so
|
Scale can be problematic. Scale applies to the contentwidth, so
|
||||||
a scale of 50 when a contentwidth is not specified is analagous to a
|
a scale of 50 when a contentwidth is not specified is analogous to a
|
||||||
width of 50%. (If a contentwidth is specified, the scaling factor can
|
width of 50%. (If a contentwidth is specified, the scaling factor can
|
||||||
be applied to that value and no problem exists.)
|
be applied to that value and no problem exists.)
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ $Date$
|
|||||||
</xsl:attribute-set>
|
</xsl:attribute-set>
|
||||||
|
|
||||||
<!-- Divisions:
|
<!-- Divisions:
|
||||||
Translate alphabetical divisons titles to by-type titles. -->
|
Translate alphabetical divisions titles to by-type titles. -->
|
||||||
<!-- The original template is in {docbook-xsl}/fo/autoidx.xsl -->
|
<!-- The original template is in {docbook-xsl}/fo/autoidx.xsl -->
|
||||||
<xsl:template match="indexterm" mode="index-div-basic">
|
<xsl:template match="indexterm" mode="index-div-basic">
|
||||||
<xsl:param name="scope" select="."/>
|
<xsl:param name="scope" select="."/>
|
||||||
|
@ -35,7 +35,7 @@ $Date$
|
|||||||
</xsl:attribute-set>
|
</xsl:attribute-set>
|
||||||
|
|
||||||
<!-- Format variablelists lists as blocks? 1 = yes, 0 = no
|
<!-- Format variablelists lists as blocks? 1 = yes, 0 = no
|
||||||
Default variablelist format. We override it when necesary
|
Default variablelist format. We override it when necessary
|
||||||
using the list-presentation processing instruction. -->
|
using the list-presentation processing instruction. -->
|
||||||
<xsl:param name="variablelist.as.blocks" select="1"/>
|
<xsl:param name="variablelist.as.blocks" select="1"/>
|
||||||
|
|
||||||
@ -171,4 +171,4 @@ $Date$
|
|||||||
<xsl:attribute name="space-before.maximum">0.2em</xsl:attribute>
|
<xsl:attribute name="space-before.maximum">0.2em</xsl:attribute>
|
||||||
</xsl:attribute-set>
|
</xsl:attribute-set>
|
||||||
|
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
@ -48,7 +48,7 @@ $Date$
|
|||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!--Divisions:
|
<!--Divisions:
|
||||||
Translate alphabetical divisons titles to by-type titles.
|
Translate alphabetical divisions titles to by-type titles.
|
||||||
Added gentext support to divisions titles.
|
Added gentext support to divisions titles.
|
||||||
Using h2 for divisions titles.
|
Using h2 for divisions titles.
|
||||||
Changed output from dl format to ul format. -->
|
Changed output from dl format to ul format. -->
|
||||||
|
@ -217,7 +217,7 @@ $Date$
|
|||||||
|
|
||||||
<!-- Body attributes:
|
<!-- Body attributes:
|
||||||
Add to the body XHTML output tag a class attribute with the book type
|
Add to the body XHTML output tag a class attribute with the book type
|
||||||
and a id atribute with the book type and version. -->
|
and a id attribute with the book type and version. -->
|
||||||
<!-- The original template is in {docbook-xsl}/xhtml/docbook.xsl -->
|
<!-- The original template is in {docbook-xsl}/xhtml/docbook.xsl -->
|
||||||
<xsl:template name="body.attributes">
|
<xsl:template name="body.attributes">
|
||||||
<xsl:attribute name="class">
|
<xsl:attribute name="class">
|
||||||
|
Loading…
Reference in New Issue
Block a user