From owner-freebsd-bugs@FreeBSD.ORG Tue Dec 16 23:10:02 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50DE51065676 for ; Tue, 16 Dec 2008 23:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2C8028FC1F for ; Tue, 16 Dec 2008 23:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id mBGNA2HZ013197 for ; Tue, 16 Dec 2008 23:10:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id mBGNA2bI013196; Tue, 16 Dec 2008 23:10:02 GMT (envelope-from gnats) Resent-Date: Tue, 16 Dec 2008 23:10:02 GMT Resent-Message-Id: <200812162310.mBGNA2bI013196@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Vladimir Chukharev Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C38261065674 for ; Tue, 16 Dec 2008 23:04:23 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id B18B08FC25 for ; Tue, 16 Dec 2008 23:04:23 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id mBGN4NTx023002 for ; Tue, 16 Dec 2008 23:04:23 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id mBGN4NWK023001; Tue, 16 Dec 2008 23:04:23 GMT (envelope-from nobody) Message-Id: <200812162304.mBGN4NWK023001@www.freebsd.org> Date: Tue, 16 Dec 2008 23:04:23 GMT From: Vladimir Chukharev To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/129697: periodic/daily/100.clean-disks and port lang/sbcl X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2008 23:10:02 -0000 >Number: 129697 >Category: misc >Synopsis: periodic/daily/100.clean-disks and port lang/sbcl >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Dec 16 23:10:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Vladimir Chukharev >Release: FreeBSD 7.1-PRERELEASE i386 >Organization: >Environment: FreeBSD chu.me.tut.fi 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #0: Sat Dec 13 11:26:37 EET 2008 root@chu.me.tut.fi:/usr/obj/usr/src/sys/CHU i386 >Description: FreebBSD port lang/sbcl installs a file /usr/local/lib/sbcl/sbcl.core This file has the name corresponding to the core dumps and it gets deleted by a cron job /etc/periodic/daily/100.clean-disks if enabled in /etc/periodic.conf. >How-To-Repeat: Install the port lang/sbcl and enable the cron job by setting in /etc/periodic.conf : daily_clean_disks_enable="YES" daily_clean_disks_days=0 As root, run /etc/periodic/daily/100.clean-disks The file /usr/local/lib/sbcl/sbcl.core will be deleted. >Fix: The attached patch introduces a new variable daily_clean_disks_ignore where the port can put a list of files to be kept, e.g. in periodic.conf: daily_clean_disks_ignore="sbcl.core" I hope that the port maintainer will add this line e.g. to the port message when the patch is applied. Comments? Patch attached with submission follows: --- /etc/periodic/daily/100.clean-disks 2007-12-24 12:11:21.000000000 +0200 +++ progs/100.clean-disks 2008-12-17 00:50:59.000000000 +0200 @@ -29,10 +29,18 @@ echo "" echo "Cleaning disks:" set -f noglob - args="$args -name "`echo "$daily_clean_disks_files" | + args="$args ( -name "`echo "$daily_clean_disks_files" | sed -e 's/^[ ]*//' \ -e 's/[ ]*$//' \ - -e 's/[ ][ ]*/ -o -name /g'` + -e 's/[ ][ ]*/ -o -name /g'`" )" + + if ! [ -z "$daily_clean_disks_ignore" ] + then + args="$args -a ! ( -name "`echo "$daily_clean_disks_ignore" | + sed -e 's/^[ ]*//' \ + -e 's/[ ]*$//' \ + -e 's/[ ][ ]*/ -o -name /g'`" )" + fi case "$daily_clean_disks_verbose" in [Yy][Ee][Ss]) @@ -41,9 +49,9 @@ print=;; esac - rc=$(find / \( ! -fstype local -o -fstype rdonly \) -a -prune -o \ - \( $args \) -atime +$daily_clean_disks_days -delete $print | - tee /dev/stderr | wc -l) + command="find / ( ! -fstype local -o -fstype rdonly ) -a -prune -o \ + ( $args ) -atime +$daily_clean_disks_days -delete $print " + rc=$($command | tee /dev/stderr | wc -l) [ -z "$print" ] && rc=0 [ $rc -gt 1 ] && rc=1 set -f glob >Release-Note: >Audit-Trail: >Unformatted: