New knob for ignoring readonly fss in 340.noid and 310.locate?
Andre Albsmeier
Andre.Albsmeier at siemens.com
Mon May 2 12:16:04 UTC 2011
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...
More information about the freebsd-rc
mailing list