Date: Mon, 2 May 2011 14:16:00 +0200 From: Andre Albsmeier <Andre.Albsmeier@siemens.com> To: Jason Hellenthal <jhell@DataIX.net> Cc: "freebsd-rc@freebsd.org" <freebsd-rc@freebsd.org> Subject: Re: New knob for ignoring readonly fss in 340.noid and 310.locate? Message-ID: <20110502121600.GB31186@curry.mchp.siemens.de> In-Reply-To: <20110502070437.GB6066@DataIX.net> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
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...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110502121600.GB31186>