summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2000-08-08 13:30:27 +0000
committerbrian <brian@FreeBSD.org>2000-08-08 13:30:27 +0000
commita4feacb3a7d261ac19e29cd9af72388144146ab5 (patch)
treea797bff8b7a07de4da9ae63ef7fd5229fa6f462f /etc
parent0390f0d80d5c0ce485037df72522890a06302008 (diff)
downloadFreeBSD-src-a4feacb3a7d261ac19e29cd9af72388144146ab5.zip
FreeBSD-src-a4feacb3a7d261ac19e29cd9af72388144146ab5.tar.gz
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
Diffstat (limited to 'etc')
-rw-r--r--etc/rc21
1 files changed, 20 insertions, 1 deletions
diff --git a/etc/rc b/etc/rc
index bea8bf4..360bc86 100644
--- a/etc/rc
+++ b/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
OpenPOWER on IntegriCloud