mirror of
https://github.com/opnsense/src.git
synced 2026-05-04 17:05:14 -04: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:
parent
a0a9cf6e5b
commit
440972bd2b
1 changed files with 20 additions and 1 deletions
21
etc/rc
21
etc/rc
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue