aboutsummaryrefslogtreecommitdiffstats
path: root/bootscripts
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@mengyan1223.wang>2021-01-13 08:44:28 +0000
committerXi Ruoyao <xry111@mengyan1223.wang>2021-01-13 08:44:28 +0000
commit02776dffe135111ad7080784e6d00a83f8396bb8 (patch)
treeaefbd76972283fd0aed1007f473a7bc6c4eb3011 /bootscripts
parenta892a142e5d2e0c3f7a37ff6c28a552f6a7bceb8 (diff)
use /run for runtime state directories
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@12093 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'bootscripts')
-rw-r--r--bootscripts/ChangeLog3
-rw-r--r--bootscripts/lfs/init.d/cleanfs10
-rw-r--r--bootscripts/lfs/init.d/rc6
-rw-r--r--bootscripts/lfs/lib/services/init-functions12
4 files changed, 17 insertions, 14 deletions
diff --git a/bootscripts/ChangeLog b/bootscripts/ChangeLog
index 03330e3d0..fd43c1222 100644
--- a/bootscripts/ChangeLog
+++ b/bootscripts/ChangeLog
@@ -1,3 +1,6 @@
+2021-01-13 Xi Ruoyao <xry111@mengyan1223.wang>
+ * Use /run instead of deprecated /var/run
+
2020-10-02 DJ Lucas <dj@linuxfromscratch.org>
* make $local_fs a Should-Stop dependency of swap to allow clean install
diff --git a/bootscripts/lfs/init.d/cleanfs b/bootscripts/lfs/init.d/cleanfs
index 2dee92967..bbca3ddf6 100644
--- a/bootscripts/lfs/init.d/cleanfs
+++ b/bootscripts/lfs/init.d/cleanfs
@@ -21,8 +21,8 @@
# Default-Start: S
# Default-Stop:
# Short-Description: Cleans temporary directories early in the boot process.
-# Description: Cleans temporary directories /var/run, /var/lock, and
-# optionally, /tmp. cleanfs also creates /var/run/utmp
+# Description: Cleans temporary directories /run, /var/lock, and
+# optionally, /tmp. cleanfs also creates /run/utmp
# and any files defined in /etc/sysconfig/createfiles.
# X-LFS-Provided-By: LFS
### END INIT INFO
@@ -95,11 +95,11 @@ case "${1}" in
find . -xdev -mindepth 1 ! -name lost+found -delete || failed=1
fi
- > /var/run/utmp
+ > /run/utmp
if grep -q '^utmp:' /etc/group ; then
- chmod 664 /var/run/utmp
- chgrp utmp /var/run/utmp
+ chmod 664 /run/utmp
+ chgrp utmp /run/utmp
fi
(exit ${failed})
diff --git a/bootscripts/lfs/init.d/rc b/bootscripts/lfs/init.d/rc
index f27f5469c..2bc155ed4 100644
--- a/bootscripts/lfs/init.d/rc
+++ b/bootscripts/lfs/init.d/rc
@@ -142,7 +142,7 @@ fi
[ "${interactive}" != "i" ] && interactive=""
# Read the state file if it exists from runlevel S
-[ -r /var/run/interactive ] && source /var/run/interactive
+[ -r /run/interactive ] && source /run/interactive
# Attempt to stop all services started by the previous runlevel,
# and killed in this runlevel
@@ -217,9 +217,9 @@ done
# Store interactive variable on switch from runlevel S and remove if not
if [ "${runlevel}" == "S" -a "${interactive}" == "i" ]; then
- echo "interactive=\"i\"" > /var/run/interactive
+ echo "interactive=\"i\"" > /run/interactive
else
- rm -f /var/run/interactive 2> /dev/null
+ rm -f /run/interactive 2> /dev/null
fi
# Copy the boot log on initial boot only
diff --git a/bootscripts/lfs/lib/services/init-functions b/bootscripts/lfs/lib/services/init-functions
index 174657f1f..2e9b15b98 100644
--- a/bootscripts/lfs/lib/services/init-functions
+++ b/bootscripts/lfs/lib/services/init-functions
@@ -358,8 +358,8 @@ killproc()
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
+ if [ -e "/run/${progname}.pid" ]; then
+ rm -f "/run/${progname}.pid" 2> /dev/null
fi
else
if [ -e "${pidfile}" ]; then rm -f "${pidfile}" 2> /dev/null; fi
@@ -434,8 +434,8 @@ pidofproc()
fi
# If a PID file exists with that name, assume that is it.
- if [ -e "/var/run/${progname}.pid" ]; then
- pidfile="/var/run/${progname}.pid"
+ if [ -e "/run/${progname}.pid" ]; then
+ pidfile="/run/${progname}.pid"
fi
fi
@@ -528,9 +528,9 @@ statusproc()
/bin/echo -e "${INFO}${base} is running with Process" \
"ID(s) ${pidlist}.${NORMAL}"
else
- if [ -n "${base}" -a -e "/var/run/${base}.pid" ]; then
+ if [ -n "${base}" -a -e "/run/${base}.pid" ]; then
/bin/echo -e "${WARNING}${1} is not running but" \
- "/var/run/${base}.pid exists.${NORMAL}"
+ "/run/${base}.pid exists.${NORMAL}"
else
if [ -n "${pidfile}" -a -e "${pidfile}" ]; then
/bin/echo -e "${WARNING}${1} is not running" \