Subject: misc/2422: /etc/daily doing too much
To: None <gnats-bugs@NetBSD.ORG>
From: Taras Ivanenko <ivanenko@ctps01.mit.edu>
List: netbsd-bugs
Date: 05/16/1996 10:43:14
>Number: 2422
>Category: misc
>Synopsis: /etc/daily script removes the files and file systems that are not related to the system
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: misc-bug-people (Misc Bug People)
>State: open
>Class: support
>Submitter-Id: net
>Arrival-Date: Thu May 16 11:05:01 1996
>Last-Modified:
>Originator: Taras Ivanenko
>Organization:
MIT
>Release: <NetBSD-current source date> 1.1
>Environment:
System: NetBSD ctps01.mit.edu 1.1 NetBSD 1.1 (ctp-sun-slc-disk) #0: Wed Mar 20 22:54:14 EST 1996 ivanenko@ctps03.mit.edu:/usr/src/sys/arch/sparc/compile/ctp-sun-slc-disk sparc
>Description:
Here is the relevant portion of /etc/daily that I want to discuss.
(Comments were added by me, not in the original release) We have
cluster-wide directory /scratch and I have notice that the files
from there disappear without any trace. As we found, it is this
script that deleted them. Does any system utilities use /scratch?
No. Does any system operation depend on /scratch existence? None
that I know of. So this part of a script should not be in
release. (Or be there in commented form). I can enforce any policy
on /scratch I want submitting another cron job. As it was originally, the
file system /scratch was erased the first day I included the NetBSD box
in a cluster (meaning set appropriate options in server:/etc/export)
#if [ -d /scratch -a ! -h /scratch ]; then
# cd /scratch && {
# find . ! -name . -atime +1 -exec rm -f -- {} \;
# find . ! -name . -type d -mtime +1 -exec rmdir -- {} \; \
# >/dev/null 2>&1; }
#fi
Same comment here. Why would a.out files and other save files be
deleted after 3 days? This can be an option but *should not* be
default option.
cd /tmp
TMP=daily.$$
#find / \( ! -fstype local -o -fstype rdonly -o -fstype fdesc \
# -o -fstype kernfs -o -fstype procfs \) -a -prune -o \
# -name 'lost+found' -a -prune -o \
# -name '*.core' -a -print -o \
# \( -name '[#,]*' -o -name '.#*' -o -name a.out \
# -o -name '*.CKP' -o -name '.emacs_[0-9]*' \) \
# -a -atime +3 -exec rm -f -- {} \; -a -print > $TMP
In general, I believe, there should not be any explicit assumptions
about the environment the system is running in the distribution
files. Cleaning /tmp and /var/tmp is justified as the system
depends on those directories, but no more than that.
>How-To-Repeat:
Leave the files on /scratch for more than 24 hours or have the file named
a.out and see it disappear.
>Fix:
Comment out the lines in /etc/daily as I did above.
>Audit-Trail:
>Unformatted: