From owner-freebsd-rc@FreeBSD.ORG Mon May 2 12:16:04 2011 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B6E4106566B for ; Mon, 2 May 2011 12:16:04 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from goliath.siemens.de (goliath.siemens.de [192.35.17.28]) by mx1.freebsd.org (Postfix) with ESMTP id F40058FC08 for ; Mon, 2 May 2011 12:16:03 +0000 (UTC) Received: from mail2.siemens.de (localhost [127.0.0.1]) by goliath.siemens.de (8.13.6/8.13.6) with ESMTP id p42CG19M027447; Mon, 2 May 2011 14:16:01 +0200 Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.40.130]) by mail2.siemens.de (8.13.6/8.13.6) with ESMTP id p42CG0oi029187; Mon, 2 May 2011 14:16:00 +0200 Received: (from localhost) by curry.mchp.siemens.de (8.14.4/8.14.4) id p42CG0S0011216; Date: Mon, 2 May 2011 14:16:00 +0200 From: Andre Albsmeier To: Jason Hellenthal Message-ID: <20110502121600.GB31186@curry.mchp.siemens.de> References: <20110430102521.GA11716@curry.mchp.siemens.de> <20110430213157.GC5660@DataIX.net> <20110501081930.GA14448@curry.mchp.siemens.de> <20110502025942.GA31396@DataIX.net> <20110502052739.GB20839@curry.mchp.siemens.de> <20110502070437.GB6066@DataIX.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110502070437.GB6066@DataIX.net> X-Echelon: X-Advice: Drop that crappy M$-Outlook, I'm tired of your viruses! User-Agent: Mutt/1.5.20 (2009-06-14) Cc: "freebsd-rc@freebsd.org" Subject: Re: New knob for ignoring readonly fss in 340.noid and 310.locate? X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 May 2011 12:16:04 -0000 On Mon, 02-May-2011 at 09:04:37 +0200, Jason Hellenthal wrote: > > Andre, > > > On Mon, May 02, 2011 at 07:27:39AM +0200, Andre Albsmeier wrote: > >On Mon, 02-May-2011 at 04:59:42 +0200, Jason Hellenthal wrote: > >> > >> Andre, > >> > >> > >> On Sun, May 01, 2011 at 10:19:30AM +0200, Andre Albsmeier wrote: > >> >On Sat, 30-Apr-2011 at 23:31:57 +0200, Jason Hellenthal wrote: > >> >> > >> >> By default snapshots directories are hidden and treated as a virtual > >> > > >> >Is it possible to hide snapshots directories in UFS? > >> > > >> > >> Snapshot directories on UFS are treated differently than they are in > >> ZFS. UFS snapshot directories live as the base of the filesystem and are > >> not auto-mounted perse when you cd(1) into them so therefore there isn't a > >> need to hide them because they cannot be traversed. > > > >They are mounted and they have to be mounted (at least here). If > >they weren't mounted, people couldn't access them. That's why > >they are also being traversed by 310.locate and 340.noid. To > >summarise: > > > >- I use UFS. > >- My snapshots must be mounted. > >- They are being traversed by 310.locate and 340.noid. > >- I don't want the latter. > > > >To accomplish this, I can play around with (directory name dependent) > >exclusion lists for 310.locate and 340.noid. I could also implement > >a rdonly knob. > > > > Well for the case of 310.locate this is already of no concern since it > can be finely tuned via /etc/locate.rc I know. But as outlined in my initial mail, I would have to tune /etc/locate.rc for each directory by name on each machine. A simple "ignore readonly mountpoints" knob would simplify things a lot. -Andre > > As for 340.noid I played around with that. It should have been modeled > after 100.setuid but it wasn't. Also doesn't really provide any real > useful information other than a filename on output. > > Attached is an adjustment to 340.noid that I think you will like and > here is some sample output. > > $ sudo sh 340.noid > > Check for files with an unknown user or group: > Directories, / > -rw-r--r-- 1 404 404 0 May 2 02:44 /test2 > -rw-r--r-- 1 root 404 0 May 2 02:52 /test3 > -rw-r--r-- 1 404 wheel 0 May 2 02:53 /test4 > > After I finish this up I am going to propose a patch for both of > 100.setuid and 340.noid so they can provide similiar output to the > above. > > For now I have just attached the modified script as it has to unset the > weekly_noid_dir variable before it brings in your local periodic configs > otherwise it wouldn't have let the script function with your config. > > Ill write back with an update once that is finished. > > PS: You should be able to just drop the attachment into the following > directories for it to take effect and then adjust the directories via > weekly_noid_dir per your periodic.conf or periodic.conf.local > > /usr/src/etc/periodic/weekly > /etc/periodic/weekly > > -- > > Regards, (jhell) > Jason Hellenthal > > #!/bin/sh - > # > # $FreeBSD: stable/8/etc/periodic/weekly/340.noid 220107 2011-03-28 19:22:55Z dougb $ > # > > # If there is a global system configuration file, suck it in. > # > if [ -r /etc/defaults/periodic.conf ] > then > . /etc/defaults/periodic.conf > unset weekly_noid_dirs > source_periodic_confs > fi > > case "$weekly_noid_enable" in > [Yy][Ee][Ss]) > echo "" > echo "Check for files with an unknown user or group:" > > MP="${weekly_noid_dirs:-`mount -t ufs,zfs |awk '{print $3}' |xargs`}" > echo "Directories, $MP" > find -sxH $MP /dev/null \ > \( ! -fstype local -prune -or -name \* \) -and \ > \( -nogroup -o -nouser \) |sed 's/^/ /' |\ > xargs ls -l > rc=$? > ;; > *) rc=0;; > esac > > exit $rc -- Division by zero error -- multiplying by zero to recover...