summaryrefslogtreecommitdiffstats
path: root/etc/rc
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2001-12-19 16:10:25 +0000
committerbrian <brian@FreeBSD.org>2001-12-19 16:10:25 +0000
commit1479e6985d9e25b9b01a136795aecb5af5b8050a (patch)
tree997f90ba0f3adef169e42f2a7a0cdf2da375cb08 /etc/rc
parent95f38d3f31676a5d99dc58683066cd0b90edf498 (diff)
downloadFreeBSD-src-1479e6985d9e25b9b01a136795aecb5af5b8050a.zip
FreeBSD-src-1479e6985d9e25b9b01a136795aecb5af5b8050a.tar.gz
Don't assume that /var/run and /var/spool/lock are on the same
partition. Submitted by: ru
Diffstat (limited to 'etc/rc')
-rw-r--r--etc/rc23
1 files changed, 13 insertions, 10 deletions
diff --git a/etc/rc b/etc/rc
index 9c17eb6..e738569 100644
--- a/etc/rc
+++ b/etc/rc
@@ -338,23 +338,26 @@ purgedir() {
}
clean_var() {
- if [ ! -f /var/run/clean_var ]; then
- purgedir /var/run /var/spool/lock
- rm -rf /var/spool/uucp/.Temp/*
+ if [ -d /var/run -a ! -f /var/run/clean_var ]; then
+ purgedir /var/run
# Keep a copy of the boot messages around
dmesg >/var/run/dmesg.boot
# And an initial utmp file
(cd /var/run && cp /dev/null utmp && chmod 644 utmp;)
>/var/run/clean_var
fi
+ if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then
+ purgedir /var/spool/lock
+ >/var/spool/lock/clean_var
+ fi
+ rm -rf /var/spool/uucp/.Temp/*
}
-if [ -d /var/run -a -d /var/spool/lock -a -d /var/spool/uucp/.Temp ]; then
- # network_pass1() *may* end up writing stuff to /var - we don't want to
- # remove it immediately afterwards - *nor* to we want to fail to clean
- # an nfs-mounted /var.
- clean_var
-fi
+# network_pass1() *may* end up writing stuff to /var - we don't want to
+# remove it immediately afterwards - *nor* do we want to fail to clean
+# an NFS-mounted /var.
+rm -f /var/run/clean_var /var/spool/lock/clean_var
+clean_var
# Add additional swapfile, if configured.
#
@@ -438,7 +441,7 @@ fi
# Clean up left-over files
#
clean_var # If it hasn't already been done
-rm /var/run/clean_var
+rm /var/run/clean_var /var/spool/lock/clean_var
# Clearing /tmp at boot-time seems to have a long tradition. It doesn't
# help in any way for long-living systems, and it might accidentally
OpenPOWER on IntegriCloud