NetBSD Problem Report #46756
From ef@math.uni-bonn.de Mon Jul 30 15:12:16 2012
Return-Path: <ef@math.uni-bonn.de>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
by www.NetBSD.org (Postfix) with ESMTP id 2CC6C63B8E6
for <gnats-bugs@gnats.NetBSD.org>; Mon, 30 Jul 2012 15:12:16 +0000 (UTC)
Message-Id: <20120730151212.BC52E1BD42@trave.math.uni-bonn.de>
Date: Mon, 30 Jul 2012 17:12:12 +0200 (CEST)
From: ef@math.uni-bonn.de
Reply-To: ef@math.uni-bonn.de
To: gnats-bugs@gnats.NetBSD.org
Subject: Ignoring subdirectories in daily's find_core
X-Send-Pr-Version: 3.95
>Number: 46756
>Category: misc
>Synopsis: Ignoring subdirectories in daily's find_core
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: misc-bug-people
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon Jul 30 15:15:00 +0000 2012
>Closed-Date: Mon Jul 30 17:30:05 +0000 2012
>Last-Modified: Wed Aug 08 14:30:02 +0000 2012
>Originator: Edgar Fuß
>Release: NetBSD 6.0_BETA2
>Organization:
Mathematisches Institut der Uni Bonn
>Environment:
System: NetBSD trave.math.uni-bonn.de 6.0_BETA2 NetBSD 6.0_BETA2 (MI12serv) #5: Mon Jul 30 12:13:14 CEST 2012 support@trave.math.uni-bonn.de:/usr/obj/sys/arch/amd64/compile/mi12serv amd64
Architecture: x86_64
Machine: amd64
>Description:
On a file server, I would like to run find_core, yet I don't want
to descend into people's home directories.
>How-To-Repeat:
Code inspection.
See also dDiscussion on tech-userlevel.
>Fix:
--- daily.orig 2012-07-27 14:41:28.000000000 +0200
+++ daily 2012-07-27 15:31:12.000000000 +0200
@@ -89,7 +89,16 @@
ignfstypes="$(echo $find_core_ignore_fstypes | \
sed -e's/\(!*\)\([^[:space:]]\{1,\}\)/-o \1 -fstype \2/g' \
-e's/^-o //')"
+ # Turn "foo bar" into "( -path foo -o -path bar ) -prune -o"
+ # Set ignpaths empty if no find_core_ignore_paths given
+ if [ -n "$find_core_ignore_paths" ]; then
+ ignpaths="$(printf " -o -path %s" $find_core_ignore_paths)"
+ ignpaths="( ${ignpaths# -o } ) -prune -o"
+ else
+ ignpaths=""
+ fi
find / \( $ignfstypes \) -prune -o \
+ ${ignpaths} \
-name 'lost+found' -prune -o \
\( -name '*.core' -o -name 'core' \) -type f -print > $TMP
# \( -name '[#,]*' -o -name '.#*' -o -name a.out \
--- daily.conf.orig 2012-07-27 15:17:32.000000000 +0200
+++ daily.conf 2012-07-27 15:18:05.000000000 +0200
@@ -11,6 +11,7 @@
find_core=YES
find_core_ignore_fstypes="!local rdonly fdesc null kernfs procfs ptyfs"
+find_core_ignore_paths=""
expire_news=NO
purge_accounting=YES
run_msgs=YES
--- daily.5.orig 2012-07-27 14:41:51.000000000 +0200
+++ daily.5 2012-07-27 15:22:23.000000000 +0200
@@ -168,6 +168,16 @@
.Ql procfs
type filesystems and filesystems that are not
.Ql local .
+.It Sy find_core_ignore_paths
+Lists paths to ignore during the
+.Sy find_core
+phase.
+For example,
+.Ql /export
+will not descend into any directories under the
+.Ql /export
+hierarchy. This, on a file server, allows to skip
+user data while still scanning system files.
.It Sy run_fsck_flags
Extra options to be passed to
.Xr fsck 8
>Release-Note:
>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/46756 CVS commit: src
Date: Mon, 30 Jul 2012 13:06:51 -0400
Module Name: src
Committed By: christos
Date: Mon Jul 30 17:06:51 UTC 2012
Modified Files:
src/etc: daily
src/etc/defaults: daily.conf
src/share/man/man5: daily.5
Log Message:
PR/46756: Edgar Fuß: Enable ignoring subdirectories in daily's find_core
To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/etc/daily
cvs rdiff -u -r1.16 -r1.17 src/etc/defaults/daily.conf
cvs rdiff -u -r1.4 -r1.5 src/share/man/man5/daily.5
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Mon, 30 Jul 2012 17:30:05 +0000
State-Changed-Why:
Committed by christos, thanks!
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/46756 CVS commit: [netbsd-6] src
Date: Wed, 8 Aug 2012 14:26:50 +0000
Module Name: src
Committed By: martin
Date: Wed Aug 8 14:26:50 UTC 2012
Modified Files:
src/etc [netbsd-6]: daily
src/etc/defaults [netbsd-6]: daily.conf
src/share/man/man5 [netbsd-6]: daily.5
Log Message:
Pull up following revision(s) (requested by christos in ticket #456):
etc/daily: revision 1.82
etc/defaults/daily.conf: revision 1.17
share/man/man5/daily.5: revision 1.5
PR/46756: Edgar Fuß: Enable ignoring subdirectories in daily's find_core
To generate a diff of this commit:
cvs rdiff -u -r1.80.2.1 -r1.80.2.2 src/etc/daily
cvs rdiff -u -r1.16 -r1.16.2.1 src/etc/defaults/daily.conf
cvs rdiff -u -r1.3.6.1 -r1.3.6.2 src/share/man/man5/daily.5
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.