mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-12-27 03:33:50 -05:00
use /run for runtime state directories
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@12093 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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})
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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" \
|
||||
|
||||
Reference in New Issue
Block a user