Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 146973 - app-admin/tmpwatch: /var/tmp/portage shall not be cleaned if emerge is running
Summary: app-admin/tmpwatch: /var/tmp/portage shall not be cleaned if emerge is running
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-09 10:15 UTC by Ulf Schaper
Modified: 2010-01-28 12:39 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
tmpwatch.cron.patch (tmpwatch.cron.patch,434 bytes, patch)
2006-09-19 06:38 UTC, Cédric Krier
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ulf Schaper 2006-09-09 10:15:14 UTC
http://www.gentoo.org/doc/en/faq.xml#tmpportage suggests not to clean /var/tmp/portage while emerge is running (maybe because some files get old mtimes if they are extracted from old archives).

The example in /etc/cron.daily/tmpwatch however does not include such a check.

I think we should include a structure such as:
if [[ -z $(/usr/bin/pgrep emerge) ]]; then
 tmpwatch /var/tmp/portage...
fi


Ulf
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-09-09 10:19:58 UTC
The example is all commented out by default. Feel free to modify as needed.

Comment 2 Cédric Krier gentoo-dev 2006-09-19 06:38:13 UTC
Created attachment 97411 [details, diff]
tmpwatch.cron.patch
Comment 3 Charlie Shepherd (RETIRED) gentoo-dev 2007-01-27 16:48:33 UTC
Thanks, fixed in CVS
Comment 4 Horst Prote 2010-01-28 12:39:32 UTC
(In reply to comment #3)
> Thanks, fixed in CVS
> 

Don't know if "/usr/bin/pgrep emerge" caught the emerge processes back in 2006/2007 but today it's output is empty although an emerge is running. That is because pgrep's "... pattern is normally only matched against the process name" but the process name is python:
ps aww | grep emerge
 9592 pts/15   S+     1:03 /usr/bin/python2.6 /usr/bin/emerge --resume

So I added option "-f" to search the full command line for the pattern and changed the pattern to "/usr/bin/emerge" not to match things like "man emerge":
if [[ ... && -z $(/usr/bin/pgrep -f /usr/bin/emerge) ]]; then

One could also use
  /usr/bin/pgrep -f "/usr/bin/python.* /usr/bin/emerge"