1
0
mirror of https://git.linuxfromscratch.org/lfs.git synced 2025-03-06 14:24:48 +00:00

Automatic merge of trunk into multilib

This commit is contained in:
Thomas Trepl (Moody) 2022-03-26 05:45:09 +01:00
commit 75af69e454
13 changed files with 90 additions and 68 deletions

View File

@ -1,3 +1,8 @@
2022-03-24 Pierre Labastie <pierre dot labastie at neuf dot fr>
* New semantics for K and S scripts:
- S scripts only started if not already marked S in the previous runlevel
- K scripts only started if not already marked K in the previous runlevel
- remove the convention of running S scripts ith "stop" in rl 0/6
2021-06-08 Bruce Dubbs <bdubbs@linuxfromscratch.org>
* When shutting down the network, ignore invalid interfaces
or interfaces that are not UP.

View File

@ -88,10 +88,10 @@ rcS: files
rc0: files
ln -sf ../init.d/network ${ETCDIR}/rc.d/rc0.d/K80network
ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc0.d/K90sysklogd
ln -sf ../init.d/sendsignals ${ETCDIR}/rc.d/rc0.d/S60sendsignals
ln -sf ../init.d/swap ${ETCDIR}/rc.d/rc0.d/S65swap
ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rc0.d/S70mountfs
ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rc0.d/S90localnet
ln -sf ../init.d/sendsignals ${ETCDIR}/rc.d/rc0.d/K92sendsignals
ln -sf ../init.d/swap ${ETCDIR}/rc.d/rc0.d/K94swap
ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rc0.d/K96mountfs
ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rc0.d/K98localnet
ln -sf ../init.d/halt ${ETCDIR}/rc.d/rc0.d/S99halt
rc1: files
@ -99,8 +99,8 @@ rc1: files
ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc1.d/K90sysklogd
rc2: files
ln -sf ../init.d/network ${ETCDIR}/rc.d/rc2.d/K80network
ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc2.d/K90sysklogd
ln -sf ../init.d/network ${ETCDIR}/rc.d/rc2.d/S10network
ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc2.d/S20sysklogd
rc3: files
ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc3.d/S10sysklogd
@ -117,10 +117,10 @@ rc5: files
rc6: files
ln -sf ../init.d/network ${ETCDIR}/rc.d/rc6.d/K80network
ln -sf ../init.d/sysklogd ${ETCDIR}/rc.d/rc6.d/K90sysklogd
ln -sf ../init.d/sendsignals ${ETCDIR}/rc.d/rc6.d/S60sendsignals
ln -sf ../init.d/swap ${ETCDIR}/rc.d/rc6.d/S65swap
ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rc6.d/S70mountfs
ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rc6.d/S90localnet
ln -sf ../init.d/sendsignals ${ETCDIR}/rc.d/rc0.d/K92sendsignals
ln -sf ../init.d/swap ${ETCDIR}/rc.d/rc0.d/K94swap
ln -sf ../init.d/mountfs ${ETCDIR}/rc.d/rc0.d/K96mountfs
ln -sf ../init.d/localnet ${ETCDIR}/rc.d/rc0.d/K98localnet
ln -sf ../init.d/reboot ${ETCDIR}/rc.d/rc6.d/S99reboot
uninstall:

View File

@ -32,11 +32,6 @@
# Native English speakers probably don't have /etc/sysconfig/console at all
[ -r /etc/sysconfig/console ] && . /etc/sysconfig/console
is_true()
{
[ "$1" = "1" ] || [ "$1" = "yes" ] || [ "$1" = "true" ]
}
failed=0
case "${1}" in

View File

@ -7,14 +7,18 @@
# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
# DJ Lucas - dj@linuxfromscratch.org
# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
# : Pierre Labastie - pierre@linuxfromscratch.org
#
# Version : LFS 7.0
#
# Notes : Update March 24th, 2022: change "stop" to "start".
# Add the $last facility to Required-start
#
########################################################################
### BEGIN INIT INFO
# Provides: halt
# Required-Start:
# Required-Start: $last
# Should-Start:
# Required-Stop:
# Should-Stop:
@ -26,12 +30,12 @@
### END INIT INFO
case "${1}" in
stop)
start)
halt -d -f -i -p
;;
*)
echo "Usage: {stop}"
echo "Usage: {start}"
exit 1
;;
esac

View File

@ -20,8 +20,8 @@
# Should-Start: $syslog firewalld iptables nftables
# Required-Stop: $local_fs localnet swap
# Should-Stop: $syslog firewalld iptables nftables
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts and configures network interfaces.
# Description: Starts and configures network interfaces.
# X-LFS-Provided-By: LFS
@ -29,6 +29,8 @@
case "${1}" in
start)
# if the default route exists, network is already configured
if ip route | grep -q "^default"; then return 0; fi
# Start all network interfaces
for file in /etc/sysconfig/ifconfig.*
do

View File

@ -6,10 +6,18 @@
#
# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
# : DJ Lucas - dj@linuxfromscratch.org
# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
# Updates : Bruce Dubbs - bdubbs@linuxfromscratch.org
# : Pierre Labastie - pierre@linuxfromscratch.org
#
# Version : LFS 7.0
#
# Notes : Updates March 24th, 2022: new semantics of S/K files
# - Instead of testing that S scripts were K scripts in the
# previous runlevel, test that they were not S scripts
# - Instead of testing that K scripts were S scripts in the
# previous runlevel, test that they were not K scripts
# - S scripts in runlevel 0 or 6 are now run with
# "script start" (was "script stop" previously).
########################################################################
. /lib/lsb/init-functions
@ -144,8 +152,9 @@ fi
# Read the state file if it exists from runlevel S
[ -r /run/interactive ] && source /run/interactive
# Attempt to stop all services started by the previous runlevel,
# and killed in this runlevel
# Stop all services marked as K, except if marked as K in the previous
# runlevel: it is the responsibility of the script to not try to kill
# a non running service
if [ "${previous}" != "N" ]; then
for i in $(ls -v /etc/rc.d/rc${runlevel}.d/K* 2> /dev/null)
do
@ -155,20 +164,8 @@ if [ "${previous}" != "N" ]; then
continue
fi
suffix=${i#/etc/rc.d/rc$runlevel.d/K[0-9][0-9]}
prev_start=/etc/rc.d/rc$previous.d/S[0-9][0-9]$suffix
sysinit_start=/etc/rc.d/rcS.d/S[0-9][0-9]$suffix
if [ "${runlevel}" != "0" -a "${runlevel}" != "6" ]; then
if [ ! -f ${prev_start} -a ! -f ${sysinit_start} ]; then
MSG="WARNING:\n\n${i} can't be "
MSG="${MSG}executed because it was not "
MSG="${MSG}not started in the previous "
MSG="${MSG}runlevel (${previous})."
log_warning_msg "$MSG"
continue
fi
fi
suffix=${i#/etc/rc.d/rc${runlevel}.d/K[0-9][0-9]}
[ -e /etc/rc.d/rc${previous}.d/K[0-9][0-9]$suffix ] && continue
run ${i} stop
error_value=${?}
@ -184,31 +181,25 @@ if [ "$runlevel" == "6" -a -n "${FASTBOOT}" ]; then
fi
# Start all functions in this runlevel
# Start all services marked as S in this runlevel, except if marked as
# S in the previous runlevel
# it is the responsabily of the script to not try to start an already running
# service
for i in $( ls -v /etc/rc.d/rc${runlevel}.d/S* 2> /dev/null)
do
if [ "${previous}" != "N" ]; then
suffix=${i#/etc/rc.d/rc$runlevel.d/S[0-9][0-9]}
stop=/etc/rc.d/rc$runlevel.d/K[0-9][0-9]$suffix
prev_start=/etc/rc.d/rc$previous.d/S[0-9][0-9]$suffix
[ -f ${prev_start} -a ! -f ${stop} ] && continue
if [ "${previous}" != "N" ]; then
suffix=${i#/etc/rc.d/rc${runlevel}.d/S[0-9][0-9]}
[ -e /etc/rc.d/rc${previous}.d/S[0-9][0-9]$suffix ] && continue
fi
check_script_status
if [ "${SCRIPT_STAT}" == "1" ]; then
SCRIPT_STAT="0"
continue
fi
if [ "${SCRIPT_STAT}" == "1" ]; then
SCRIPT_STAT="0"
continue
fi
case ${runlevel} in
0|6)
run ${i} stop
;;
*)
run ${i} start
;;
esac
run ${i} start
error_value=${?}

View File

@ -6,15 +6,19 @@
#
# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
# DJ Lucas - dj@linuxfromscratch.org
# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
# Updates : Bruce Dubbs - bdubbs@linuxfromscratch.org
# : Pierre Labastie - pierre@linuxfromscratch.org
#
# Version : LFS 7.0
#
# Notes : Update March 24th, 2022: change "stop" to "start".
# Add the $last facility to Required-start
#
########################################################################
### BEGIN INIT INFO
# Provides: reboot
# Required-Start:
# Required-Start: $last
# Should-Start:
# Required-Stop:
# Should-Stop:
@ -28,13 +32,13 @@
. /lib/lsb/init-functions
case "${1}" in
stop)
start)
log_info_msg "Restarting system..."
reboot -d -f -i
;;
*)
echo "Usage: ${0} {stop}"
echo "Usage: ${0} {start}"
exit 1
;;

View File

@ -18,17 +18,14 @@
# Should-Start:
# Required-Stop: $local_fs
# Should-Stop: sendsignals
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# 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
# Note: sysklogd is not started in runlevel 2 due to possible
# remote logging configurations
. /lib/lsb/init-functions
case "${1}" in

View File

@ -30,12 +30,26 @@
case "${1}" in
start)
log_info_msg "Starting..."
# if it is possible to use start_daemon
start_daemon fully_qualified_path
# if it is not possible to use start_daemon
# (command to start the daemon is not simple enough)
if ! pidofproc daemon_name_as_reported_by_ps >/dev/null; then
command_to_start_the_service
fi
evaluate_retval
;;
stop)
log_info_msg "Stopping..."
# if it is possible to use killproc
killproc fully_qualified_path
# if it is not possible to use killproc
# (the daemon shoudn't be stopped by killing it)
if pidofproc daemon_name_as_reported_by_ps >/dev/null; then
command_to_stop_the_service
fi
evaluate_retval
;;
restart)

View File

@ -700,7 +700,7 @@ log_info_msg2()
################################################################################
# evaluate_retval() #
# Usage: Evaluate a return value and print success or failyure as appropriate #
# Usage: Evaluate a return value and print success or failure as appropriate #
# #
# Purpose: Convenience function to terminate an info message #
# #

View File

@ -40,6 +40,16 @@
appropriate for the entry or if needed the entire day's listitem.
-->
<listitem>
<para>2022-03-25</para>
<itemizedlist>
<listitem>
<para>[pierre] - Update bootscripts to 20220324. Fixes
<ulink url="&lfs-ticket-root;5027">#5027</ulink>.</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>2022-03-20</para>
<itemizedlist>

View File

@ -157,7 +157,7 @@ EOF</userinput></screen>
script is run with the <parameter>stop</parameter> argument. When an S link
is encountered, the appropriate script is run with the
<parameter>start</parameter> argument.</para>
<!-- Changed for March 24th, 2022 version of bootscripts
<para>There is one exception to this explanation. Links that start
with an <emphasis>S</emphasis> in the <filename
class="directory">rc0.d</filename> and <filename
@ -170,7 +170,7 @@ EOF</userinput></screen>
run before any <emphasis>S</emphasis> prefixed scripts are run with the
<parameter>stop</parameter> parameter.
</para>
-->
<para>These are descriptions of what the arguments make the scripts
do:</para>

View File

@ -394,7 +394,7 @@
<!ENTITY less-fin-du "4.2 MB">
<!ENTITY less-fin-sbu "less than 0.1 SBU">
<!ENTITY lfs-bootscripts-version "20210608"> <!-- Scripts depend on this format -->
<!ENTITY lfs-bootscripts-version "20220324"> <!-- Scripts depend on this format -->
<!ENTITY lfs-bootscripts-size "BOOTSCRIPTS-SIZE KB">
<!ENTITY lfs-bootscripts-url "&downloads-root;lfs-bootscripts-&lfs-bootscripts-version;.tar.xz">
<!ENTITY lfs-bootscripts-md5 "BOOTSCRIPTS-MD5SUM">