Summary: | [patch] fix misbehavior of periodic/daily/100.clean-disks vs. port lang/sbcl | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | V.Chukharev <chukharev> | ||||||
Component: | conf | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||||
Status: | Open --- | ||||||||
Severity: | Affects Only Me | CC: | bsd | ||||||
Priority: | Normal | Keywords: | patch | ||||||
Version: | 7.1-PRERELEASE | ||||||||
Hardware: | Any | ||||||||
OS: | Any | ||||||||
Attachments: |
|
Description
V.Chukharev
2008-12-16 23:10:01 UTC
I have made a new patch. Now it uses full path to the preserved files. Among other files, sbcl installs two a.out files, and preserving all files with this name like the original patch did is too much I think. I've used the patch with the following lines in /etc/periodic.conf for few days now. daily_clean_disks_enable="YES" # Delete files daily #daily_clean_disks_files="[#,]* .#* a.out *.core *.CKP .emacs_[0-9]*" daily_clean_disks_days=2 # If older than this daily_clean_disks_ignore="$daily_clean_disks_ignore /usr/local/lib/sbcl/sbcl.core" # lang/sbcl daily_clean_disks_ignore="$daily_clean_disks_ignore /usr/local/lib/sbcl/sb-bsd-sockets/a.out" # lang/sbcl daily_clean_disks_ignore="$daily_clean_disks_ignore /usr/local/lib/sbcl/sb-posix/a.out" # lang/sbcl daily_clean_disks_ignore="$daily_clean_disks_ignore /usr/local/lib/maxima/5.*/binary-sbcl/maxima.core" # math/maxima Of course, all these changes to periodic is actially only a temporary amendment. The real solution is to enforce the ports policy of renaming all files corresponding to the special cases. I have filed another PR ports/131790 with a feature request to portlint that it warns about the name collisions like these. I CC to port maintainers of math/maxima and lang/sbcl so that they know about the issue and might try to rename the offending files. -- V. Chukharev This PR is similar to http://www.FreeBSD.org/cgi/query-pr.cgi?pr=conf/35545 and http://www.freebsd.org/cgi/query-pr.cgi?pr=conf/84752 -- Vladimir Chukharev Tampere University of Technology The old patch worked for me for at least six months with no problems. Then I made something in Windows (the machine is dual boot notebook), and found the following. The windows filesystem is automatically mounted by gnome, it is not marked as read-only but write operations on it are not allowed. So it is scanned by 100.clean-disks resulting in messages in mails like rm: #SharedObjects: Operation not supported A new version of the patch includes one more variable, daily_clean_disks_prune, containing a list of directories to ignore with all their subdirectories. Additionally, the new variables get empty strings as default values and comments document meaning of the variables in /etc/defaults/periodic.conf. NB. The script is off by default, thus the patch is not changing the default behavior. Perhaps, "/media" (or even "/media /mnt") is a better default for daily_clean_disks_prune. The file has mixed tabs and spaces, this might be nice to fix in a separate cosmetic patch. === --- etc/defaults/periodic.conf.orig 2009-06-25 16:49:49.000000000 +0300 +++ etc/defaults/periodic.conf 2009-11-17 12:28:35.000000000 +0200 @@ -40,6 +40,8 @@ daily_clean_disks_files="[#,]* .#* a.out *.core *.CKP .emacs_[0-9]*" daily_clean_disks_days=3 # If older than this daily_clean_disks_verbose="YES" # Mention files deleted +daily_clean_disks_prune="" # Directories to ignore +daily_clean_disks_ignore="" # Files to ignore # 110.clean-tmps daily_clean_tmps_enable="NO" # Delete stuff daily --- etc/periodic/daily/100.clean-disks.orig 2009-10-24 18:20:24.000000000 +0300 +++ etc/periodic/daily/100.clean-disks 2009-11-17 16:15:06.000000000 +0200 @@ -29,10 +29,18 @@ echo "" echo "Cleaning disks:" set -f noglob - args="-name "`echo "$daily_clean_disks_files" | + 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 ! ( -path "`echo "$daily_clean_disks_ignore" | + sed -e 's/^[ ]*//' \ + -e 's/[ ]*$//' \ + -e 's/[ ][ ]*/ -o -path /g'`" )" + fi case "$daily_clean_disks_verbose" in [Yy][Ee][Ss]) @@ -41,9 +49,19 @@ print=;; esac - rc=$(find / \( ! -fstype local -o -fstype rdonly \) -prune -o \ - \( $args \) -atime +$daily_clean_disks_days \ - -execdir rm -df {} \; $print | tee /dev/stderr | wc -l) + if ! [ -z "$daily_clean_disks_prune" ] + then + prune="-o -path "`echo "$daily_clean_disks_prune" | + sed -e 's/^[ ]*//' \ + -e 's/[ ]*$//' \ + -e 's/[ ][ ]*/ -o -path /g'` + else + prune="" + fi + + command="find / ( ! -fstype local -o -fstype rdonly $prune ) -prune -o ( \ + ( $args ) -atime +$daily_clean_disks_days -execdir rm -df {} ; $print )" + rc=$($command | tee /dev/stderr | wc -l) [ -z "$print" ] && rc=0 [ $rc -gt 1 ] && rc=1 set -f glob === -- Vladimir Chukharev Tampere University of Technology State Changed From-To: open->closed 100.clean-disks is disabled by default, and the user needs to configure /etc/periodic.conf before it can be used. Very weird logic in the explanation why... With this logic, all ports which need *_enable="YES" in rc.conf should never be fixed, which is definitely not the case. If you just want to reduce the number of open PRs, put a reference to the one left open and a back reference in that one. A good candidate is conf/35545. Sorry I found that and other related PRs too late. Vladimir Chukharev State Changed From-To: closed->open Re-open. 100.clean-disks should probably check that any .core files it removes are actually core files. Responsible Changed From-To: freebsd-bugs->brucec Track. Responsible Changed From-To: brucec->freebsd-bugs Back to the pool. For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped This is still affecting SBCL unfortunately. Right now I am doing the core cleanup manually, but it would be nice to be able to rely on FreeBSD's Base System's mechanism. Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi> |