Changeset 27d23b1 for bootscripts/lfs
- Timestamp:
- 03/25/2022 09:19:53 AM (3 years ago)
- Branches:
- 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 12.2, 12.2-rc1, bdubbs/gcc13, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/loongarch-12.2, xry111/mips64el, xry111/multilib, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- 887af77
- Parents:
- 17c6532
- git-author:
- Pierre Labastie <pierre.labastie@…> (03/22/2022 10:13:19 AM)
- git-committer:
- Pierre Labastie <pierre.labastie@…> (03/25/2022 09:19:53 AM)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
bootscripts/lfs/init.d/rc
r17c6532 r27d23b1 7 7 # Authors : Gerard Beekmans - gerard@linuxfromscratch.org 8 8 # : DJ Lucas - dj@linuxfromscratch.org 9 # Update : Bruce Dubbs - bdubbs@linuxfromscratch.org 9 # Updates : Bruce Dubbs - bdubbs@linuxfromscratch.org 10 # : Pierre Labastie - pierre@linuxfromscratch.org 10 11 # 11 12 # Version : LFS 7.0 12 13 # 14 # Notes : Updates March 24th, 2022: new semantics of S/K files 15 # - Instead of testing that S scripts were K scripts in the 16 # previous runlevel, test that they were not S scripts 17 # - Instead of testing that K scripts were S scripts in the 18 # previous runlevel, test that they were not K scripts 19 # - S scripts in runlevel 0 or 6 are now run with 20 # "script start" (was "script stop" previously). 13 21 ######################################################################## 14 22 … … 145 153 [ -r /run/interactive ] && source /run/interactive 146 154 147 # Attempt to stop all services started by the previous runlevel, 148 # and killed in this runlevel 155 # Stop all services marked as K, except if marked as K in the previous 156 # runlevel: it is the responsibility of the script to not try to kill 157 # a non running service 149 158 if [ "${previous}" != "N" ]; then 150 159 for i in $(ls -v /etc/rc.d/rc${runlevel}.d/K* 2> /dev/null) … … 156 165 fi 157 166 158 suffix=${i#/etc/rc.d/rc$runlevel.d/K[0-9][0-9]} 159 prev_start=/etc/rc.d/rc$previous.d/S[0-9][0-9]$suffix 160 sysinit_start=/etc/rc.d/rcS.d/S[0-9][0-9]$suffix 161 162 if [ "${runlevel}" != "0" -a "${runlevel}" != "6" ]; then 163 if [ ! -f ${prev_start} -a ! -f ${sysinit_start} ]; then 164 MSG="WARNING:\n\n${i} can't be " 165 MSG="${MSG}executed because it was not " 166 MSG="${MSG}not started in the previous " 167 MSG="${MSG}runlevel (${previous})." 168 log_warning_msg "$MSG" 169 continue 170 fi 171 fi 167 suffix=${i#/etc/rc.d/rc${runlevel}.d/K[0-9][0-9]} 168 [ -e /etc/rc.d/rc${previous}.d/K[0-9][0-9]$suffix ] && continue 172 169 173 170 run ${i} stop … … 185 182 186 183 187 # Start all functions in this runlevel 184 # Start all services marked as S in this runlevel, except if marked as 185 # S in the previous runlevel 186 # it is the responsabily of the script to not try to start an already running 187 # service 188 188 for i in $( ls -v /etc/rc.d/rc${runlevel}.d/S* 2> /dev/null) 189 189 do 190 190 191 if [ "${previous}" != "N" ]; then 191 suffix=${i#/etc/rc.d/rc$runlevel.d/S[0-9][0-9]} 192 stop=/etc/rc.d/rc$runlevel.d/K[0-9][0-9]$suffix 193 prev_start=/etc/rc.d/rc$previous.d/S[0-9][0-9]$suffix 194 195 [ -f ${prev_start} -a ! -f ${stop} ] && continue 192 suffix=${i#/etc/rc.d/rc${runlevel}.d/S[0-9][0-9]} 193 [ -e /etc/rc.d/rc${previous}.d/S[0-9][0-9]$suffix ] && continue 196 194 fi 197 195 198 196 check_script_status 199 if [ "${SCRIPT_STAT}" == "1" ]; then 200 SCRIPT_STAT="0" 201 continue 202 fi 203 204 case ${runlevel} in 205 0|6) 206 run ${i} stop 207 ;; 208 *) 209 run ${i} start 210 ;; 211 esac 197 if [ "${SCRIPT_STAT}" == "1" ]; then 198 SCRIPT_STAT="0" 199 continue 200 fi 201 202 run ${i} start 212 203 213 204 error_value=${?}
Note:
See TracChangeset
for help on using the changeset viewer.