Subject: Re: misc/1919: merging functionality of netstart, etc, into rc
To: Olaf Seibert <rhialto@mbfys.kun.nl>
From: Bernd Felsche <bernie@metapro.metapro.DIALix.oz.au>
List: netbsd-bugs
Date: 01/12/1996 10:10:01
According to Olaf Seibert:

>der Mouse <mouse@Collatz.McRCIM.McGill.EDU> wrote:
>> - The "clearing /tmp" code is yanked entirely; this should be done by
>>   cron, not rebooting.  (Doing it on reboot cleans out /tmp both too
>>   often - essentially, it means /tmp is useless to humans because
>>   anything in there may be torched randomly if the machine crashes -
>>   and not often enough, because if the box doesn't die it never gets
>>   cleaned out.)

IMO /tmp is for system use only.  /var/tmp is for end-user applications.

>The last part is not true, unless somebody changed it after 1.0.
>In my (mostly 1.0) /etc/daily I find, right at the top:

>echo "Removing scratch and junk files:"
>if [ -d /tmp -a ! -h /tmp ]; then
>        cd /tmp && {
>        find . -type f -atime +7 -exec rm -f -- {} \;
>        find . ! -name . -type d -mtime +2 -exec rmdir -- {} \; \
>            >/dev/null 2>&1; }
>fi

Problem with that is that the directories which contained files just
removed, won't be deleted. Also, directories with recently-accessed
files will be rmdir'd when that won't work. (I suppose that's why
you're directing errors to /dev/null.)

>and similar lines for /var/tmp and /scratch.

>I did change some atime values here and there so your version may differ
>slightly.

You should also check to see if the file is being held open by a
current process ... has lsof been ported yet?

-- 
Bernd Felsche {speaking for himself}
MetaPro Systems Pty Ltd, 130 Fauntleroy Avenue,
Redcliffe, Western Australia 6104
Phone: +61 9 479 3722    Fax: +61 9 479 3720