From owner-freebsd-audit Thu Jun 8 16: 5:53 2000 Delivered-To: freebsd-audit@freebsd.org Received: from Awfulhak.org (tun.AwfulHak.org [194.242.139.173]) by hub.freebsd.org (Postfix) with ESMTP id AA60737C202; Thu, 8 Jun 2000 16:05:21 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (root@hak.lan.awfulhak.org [172.16.0.12]) by Awfulhak.org (8.9.3/8.9.3) with ESMTP id AAA02463; Fri, 9 Jun 2000 00:09:15 +0100 (BST) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.9.3/8.9.3) with ESMTP id AAA35033; Fri, 9 Jun 2000 00:09:11 +0100 (BST) (envelope-from brian@Awfulhak.org) Message-Id: <200006082309.AAA35033@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.1.1 10/15/1999 To: Kris Kennaway Cc: Brian Somers , Clive Lin , Valentin Nechayev , Brian Somers , cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, brian@hak.lan.awfulhak.org, freebsd-audit@FreeBSD.ORG Subject: Request for review (was: cvs commit: src/etc/periodic/daily 110.clean-tmps ) In-Reply-To: Message from Kris Kennaway of "Thu, 08 Jun 2000 14:19:45 PDT." Mime-Version: 1.0 Content-Type: multipart/mixed ; boundary="==_Exmh_7420186240" Date: Fri, 09 Jun 2000 00:09:10 +0100 From: Brian Somers Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This is a multipart MIME message. --==_Exmh_7420186240 Content-Type: text/plain; charset=us-ascii > On Thu, 8 Jun 2000, Brian Somers wrote: > > > With this in defaults/rc.conf: > > > > clear_daily_ignore=".X*-lock quota.user quota.group" # Don't delete these > > clear_daily_dirs="/tmp /var/tmp /compat/linux/tmp" # Delete stuff here > > clear_daily_days= # Older than this (3?) > > I'd also suggest having the list of removed files added to the daily > sysadmin mailing. I've been bitten by something like this before - a > daemon was periodically dying and I finally figured out it was because a > long-lived tempfile was being reaped. A daily report of files removed > would show you whether you might need to add some more files to the ignore > list. Ok, here's the latest draft. Please let me know if there are any problems. I've cc'd freebsd-audit at Robert W's request, so please also keep the cc list in mind when replying. > Kris > > -- > In God we Trust -- all others must submit an X.509 certificate. > -- Charles Forsythe --==_Exmh_7420186240 Content-Type: application/x-patch ; name="rc.conf.5.patch" Content-Description: rc.conf.5.patch Content-Disposition: attachment; filename="rc.conf.5.patch" Index: rc.conf.5 =================================================================== RCS file: /home/ncvs/src/share/man/man5/rc.conf.5,v retrieving revision 1.71 diff -u -r1.71 rc.conf.5 --- rc.conf.5 2000/05/09 08:09:31 1.71 +++ rc.conf.5 2000/06/08 23:01:53 @@ -1153,6 +1153,30 @@ if you want .Pa /tmp to be cleaned at startup. +.It Ar clear_daily_enable +(bool) Set to +.Ar YES +if you want to clear temporary directories daily. +.It Ar clear_daily_dirs +(str) Set to the list of directories to clear if +.Ar clear_daily_enable +is set to +.Ar YES . +.It Ar clear_daily_days +(int) When +.Ar clear_daily_enable +is set, this must also be set to the number of days old that a file's access +and modification times must be before it's deleted. +.It Ar clear_daily_ignore +(str) Set to the list of files that should not be deleted when +.Ar clear_daily_enable +is set to +.Ar YES . +Wild cards are permitted. +.It Ar clear_daily_verbose +(bool) Set to +.Ar YES +if you want the removed files to be reported in your daily output. .It Ar ldconfig_paths (str) Set to the list of shared library paths to use with .Xr ldconfig 8 . --==_Exmh_7420186240 Content-Type: text/plain ; name="rc.conf.add"; charset=us-ascii Content-Description: rc.conf.add Content-Disposition: attachment; filename="rc.conf.add" clear_daily_enable="NO" # Delete stuff daily clear_daily_dirs="/tmp /compat/linux/tmp" # Delete under here clear_daily_days="3" # If older than this clear_daily_ignore=".X*-lock quota.user quota.group" # Don't delete these clear_daily_verbose="YES" # Mention files deleted --==_Exmh_7420186240 Content-Type: text/plain ; name="110.clean-tmps"; charset=us-ascii Content-Description: 110.clean-tmps Content-Disposition: attachment; filename="110.clean-tmps" #!/bin/sh # # $FreeBSD: src/etc/periodic/daily/110.clean-tmps,v 1.7 2000/06/08 08:48:15 brian Exp $ # # Perform temporary directory cleaning so that long-lived systems # don't end up with excessively old files there. If /var/tmp and # /tmp are symlinked together, only one of the below will actually # run. # # If there is a global system configuration file, suck it in. # if [ -r /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf source_rc_confs elif [ -r /etc/rc.conf ]; then . /etc/rc.conf fi case "$clear_daily_enable" in [Yy][Ee][Ss]) if [ -n "$clear_daily_days" ] then echo "" echo "Removing old temporary files:" set -f noglob args="-atime +$clear_daily_days -mtime +$clear_daily_days" [ -n "$clear_daily_ignore" ] && args="$args "`echo " ${clear_daily_ignore% }" | sed 's/[ ][ ]*/ ! -name /g'` case "$clear_daily_verbose" in [Yy][Ee][Ss]) print=-print;; *) print=;; esac for dir in $clear_daily_dirs do [ ."${dir#/}" != ."$dir" -a -d $dir ] && cd $dir && { find -d . -type f $args -delete $print find -d . ! -name . -type d -mtime +$clear_daily_days \ -delete $print } | sed "s,^\\., $dir," done set -f glob fi;; esac --==_Exmh_7420186240-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message