1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-11 14:10:34 +00:00

Don't use find(1) before nfs filesystems have been mounted as

it lives in /usr/bin.  Instead, locate files manually.

Note, only *files* under /var/spool/lock are now deleted rather
than everything that's not a directory.  I think this is more
correct, but if anyone disagrees please feel free to change it.

Problem pointed out by: bde
This commit is contained in:
Brian Somers 2000-08-08 13:30:27 +00:00
parent a0a9cf6e5b
commit 440972bd2b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=64400

21
etc/rc
View File

@ -156,10 +156,29 @@ esac
adjkerntz -i
purgedir() {
local dir file
if [ $# -eq 0 ]; then
purgedir .
else
for dir
do
(
cd "$dir" && ls | while read file
do
[ -d "$file" ] && purgedir "$file"
[ -f "$file" ] && rm -f "$file"
done
)
done
fi
}
clean_var() {
if [ ! -f /var/run/clean_var ]; then
rm -rf /var/run/*
find /var/spool/lock ! -type d -delete
purgedir /var/spool/lock
rm -rf /var/spool/uucp/.Temp/*
# Keep a copy of the boot messages around
dmesg >/var/run/dmesg.boot