diff options
author | brian <brian@FreeBSD.org> | 2000-08-08 13:30:27 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2000-08-08 13:30:27 +0000 |
commit | a4feacb3a7d261ac19e29cd9af72388144146ab5 (patch) | |
tree | a797bff8b7a07de4da9ae63ef7fd5229fa6f462f /etc/rc | |
parent | 0390f0d80d5c0ce485037df72522890a06302008 (diff) | |
download | FreeBSD-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/rc')
-rw-r--r-- | etc/rc | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -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 |