summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1996-06-22 13:05:20 +0000
committerjoerg <joerg@FreeBSD.org>1996-06-22 13:05:20 +0000
commitf922895864188c2cf56283cde36655ca8200dbfe (patch)
tree4546e96ce025c0d34f046f85decfda33b10f1dcc
parentfac2ce3b1236438834d415410078fc73bacc4fcd (diff)
downloadFreeBSD-src-f922895864188c2cf56283cde36655ca8200dbfe.zip
FreeBSD-src-f922895864188c2cf56283cde36655ca8200dbfe.tar.gz
Add a few hints about the cleaning policy of /tmp, including an example
(commented out) for how to purge it regularly.
-rw-r--r--etc/daily24
-rw-r--r--etc/rc19
2 files changed, 42 insertions, 1 deletions
diff --git a/etc/daily b/etc/daily
index 423063e..25cc17e 100644
--- a/etc/daily
+++ b/etc/daily
@@ -30,6 +30,30 @@ cd /tmp
# -o -name '*.CKP' -o -name '.emacs_[0-9]*' \) \
# -a -atime +3 -exec rm -f -- {} \;
#
+#
+# The same security hole. Purge the temp directories from unused stuff.
+# Note that we must not accidentally clean the X11 lock files.
+#
+# Use at your own risk, but for a long-living system, this might come
+# more useful than the boot-time cleaning of /tmp. If /var/tmp and
+# /tmp are symlinked together, only one of the below will actually
+# run.
+#
+# if [ -d /tmp ]; then
+# cd /tmp && {
+# find . -type f -atime +3 -ctime +3 ! -name '.X*-lock' -exec rm -f -- {} \;
+# find -d . ! -name . -type d -mtime +1 -exec rmdir -- {} \; \
+# >/dev/null 2>&1; }
+# fi
+#
+# if [ -d /var/tmp ]; then
+# cd /var/tmp && {
+# find . ! -name . -atime +7 -ctime +3 -exec rm -f -- {} \;
+# find -d . ! -name . -type d -mtime +1 -exec rmdir -- {} \; \
+# >/dev/null 2>&1; }
+# fi
+#
+#
# remove system messages older than 21 days
msgs -c
diff --git a/etc/rc b/etc/rc
index c53d96f..45678ad 100644
--- a/etc/rc
+++ b/etc/rc
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: rc,v 1.90 1996/05/19 22:30:26 ache Exp $
+# $Id: rc,v 1.91 1996/06/15 17:04:48 jkh Exp $
# From: @(#)rc 5.27 (Berkeley) 6/5/91
# System startup script run by init on autoboot
@@ -118,6 +118,15 @@ rm -rf /var/spool/uucp/.Temp/*
rm -f /dev/log
(cd /var/run && { cp /dev/null utmp; chmod 644 utmp; })
+#
+# Clearing /tmp at boot-time is essentially stupid, but seems to have
+# a long tradition. It doesn't help in any way for long-living systems,
+# and it might accidentally clobber files you would rather like to have
+# preserved after a crash (if not using mfs /tmp anyway).
+#
+# See also the commented out example of another cleanup policy in
+# /etc/daily.
+#
echo clearing /tmp
# prune quickly with one rm, then use find to clean up /tmp/[lq]*
@@ -125,6 +134,14 @@ echo clearing /tmp
(cd /tmp && rm -rf [a-km-pr-zA-Z]* &&
find -d . ! -name . ! -name lost+found ! -name quotas -exec rm -rf -- {} \;)
+# The above is even more stupid since it prevents you from restarting
+# X11 after a system crash. If you disable the above, make sure to
+# uncomment the line below.
+#
+# clean up leftover X lock files and local connection sockets
+#rm -f /tmp/.X*-lock /tmp/.X11-unix/*
+
+
# enable dumpdev so that savecore can see it
if [ "X${dumpdev}" != X"NO" ]; then
dumpon ${dumpdev}
OpenPOWER on IntegriCloud