Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 33162 - Using userpriv and usersandbox causes distcc and ccache to stop working
Summary: Using userpriv and usersandbox causes distcc and ccache to stop working
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - External Interaction (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-10 13:12 UTC by Michael Imhof (RETIRED)
Modified: 2005-03-31 11:11 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Imhof (RETIRED) gentoo-dev 2003-11-10 13:12:09 UTC
When i have userpriv and usersandbox in FEATURES I'm getting access violations while emerging mozilla (emrging other things shows the same errors).

web root # emerge mozilla
Calculating dependencies ...done!
>>> emerge (1 of 1) net-www/mozilla-1.4-r3 to /
>>> md5 src_uri ;-) mozilla-source-1.4.tar.bz2
>>> md5 src_uri ;-) enigmail-0.76.4.tar.gz
>>> md5 src_uri ;-) ipc-1.0.3.tar.gz
flag-o-matic
gcc
eutils
nsplugins
distcc[28052] (dcc_open_lockfile) ERROR: failed to creat /var/tmp/portage/.distcc/lock/cpu_localhost_0: Permission denied
distcc[28052] (dcc_lock_one) ERROR: failed to lock
distcc[28064] (dcc_open_lockfile) ERROR: failed to creat /var/tmp/portage/.distcc/lock/cpu_localhost_0: Permission denied
distcc[28064] (dcc_lock_one) ERROR: failed to lock
>>> Unpacking source...
Comment 1 Michael Imhof (RETIRED) gentoo-dev 2003-11-10 13:13:08 UTC
web root # emerge info
Portage 2.0.49-r15 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r1, 2.6.0-test7-bk8)
=================================================================
System uname: 2.6.0-test7-bk8 i686 VIA Ezra
Gentoo Base System version 1.4.3.10p1
distcc 2.11.1 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.3 [enabled]
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-mcpu=i686 -m3dnow -O3 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config
/usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/NX/etc /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-mcpu=i686 -m3dnow -O3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs sandbox ccache distcc fixpackages userpriv usersandbox"
GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo
ftp://ftp.fhh.opensource-mirror.de/pub/gentoo.org/ ftp://linux.rz.ruhr-uni-bochum.de/gentoo-mirror/
ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 oss apm avi crypt cups encode foomaticdb gif jpeg gnome libg++ libwww
mad mikmod mpeg ncurses nls pdflib png quicktime spell truetype xml2 xmms
xv zlib gdbm berkdb slang readline arts svga tcltk java X sdl gpm tcpd pam
ssl perl python esd imlib oggvorbis gtk qt kde motif opengl apache2"
Comment 2 Michael Imhof (RETIRED) gentoo-dev 2003-11-10 13:15:35 UTC
web root # ls -al /var/tmp/portage/
total 828
drwxr-xr-x  206 portage  portage      8192 Nov 10 22:02 .
drwxrwxrwt    5 root     root         4096 Nov 10 18:36 ..
drwxrwsr-x    4 portage  portage      4096 Nov 10 19:39 .distcc


web root # ls -al /var/tmp/portage/.distcc/
total 20
drwxrwsr-x    4 portage  portage      4096 Nov 10 19:39 .
drwxr-xr-x  206 portage  portage      8192 Nov 10 22:02 ..
drwxrwsr-x    2 portage  portage      4096 Nov 10 21:31 lock
drwxrwsr-x    2 portage  portage      4096 Nov 10 22:02 state

web root # ls -al /var/tmp/portage/.distcc/lock/
total 8
drwxrwsr-x    2 portage  portage      4096 Nov 10 21:31 .
drwxrwsr-x    4 portage  portage      4096 Nov 10 19:39 ..
-rw-r--r--    1 root     portage         0 Nov 10 19:39 cpu_localhost_0
-rw-r--r--    1 portage  portage         0 Nov 10 21:31 cpu_tcp_192.168.0.10_3632_0

web root # ls -al /var/tmp/portage/.distcc/state/
total 12
drwxrwsr-x    2 portage  portage      4096 Nov 10 22:02 .
drwxrwsr-x    4 portage  portage      4096 Nov 10 19:39 ..
-rw-r--r--    1 root     portage       280 Nov 10 22:02 binstate_27901


Comment 3 Michael Imhof (RETIRED) gentoo-dev 2003-11-10 13:20:02 UTC
For distcc I think privs are dropped and it is no longer allowed to lock
because of wrong perms.


For ccache i can't give you that much information. But when userpriv and
usersandbox is in FEATURES, then "ccache -s" shows no new hits/fails and
the cache  is not getting larger.
I haven't found out why it is not working, but i think it is due to wrong
permissions.
Comment 4 Nicholas Jones (RETIRED) gentoo-dev 2003-12-22 23:43:48 UTC
Lisa: Comments?
Comment 5 Lisa Seelye (RETIRED) gentoo-dev 2003-12-23 09:40:47 UTC
The core problem is the existence of /v/t/p/.distcc/lock/cpu_localhost_0 as root:portage.

This seems like an issue that was fixed.  If you recall, Nick, I came to you bugging you about this -- and I could have sworn you fixed it.

Tantive, has this been repeated with a higher-versioned Portage?  What happens if you rm -f /var/tmp/portage/.distcc/lock/cpu_localhost_0 ? Is it still re-created as root:portage?
Comment 6 Michael Imhof (RETIRED) gentoo-dev 2003-12-27 03:43:24 UTC
I upgraded portage to 2.0.49-r18.
It is now created as portage:portage.

mobile root # ls -l /var/tmp/portage/.distcc/lock/cpu_localhost_0
-rw-r--r--    1 portage  portage         0 Dec 27 12:38 /var/tmp/portage/.distcc/lock/cpu_localhost_0


BUT

ccache is still not working.
It gives me the same stats every time i call ccache -s.
Comment 7 Michael Imhof (RETIRED) gentoo-dev 2003-12-27 03:45:14 UTC
If i disable userpriv and usersandbox ccache works like a charm. So i think we should do some little adjustments here as well.
Comment 8 Lisa Seelye (RETIRED) gentoo-dev 2003-12-27 08:29:56 UTC
If I recall correctly there has been a standing issue (bug 22125) regarding permissions for ccache.  I also seem to recall an issue with ccache being created in /root/.ccache (ie, dropping root after invoking gcc).
Comment 9 Marius Mauch (RETIRED) gentoo-dev 2004-02-04 19:26:26 UTC
ccache is working fine here with userpriv and 2.0.50_pre22, so can this be closed?
Comment 10 Nicholas Jones (RETIRED) gentoo-dev 2004-02-05 00:52:58 UTC
Userpriv throws CCACHE_DIR into /var/tmp/ccache ... So you wouldn't
see updates unless you changed your shell to there as well. It's a
user/permission issue. Didn't want to much around in /root.
Comment 11 Vaclav Slavik 2004-12-31 18:06:23 UTC
This bug is *not* fixed. /var/tmp/ccache has incorrect permissions, some files are created with root as the owner, not portage user. Manually running

chown -R portage:portage /var/tmp/ccache

after Portage creates /var/tmp/ccache fixes it.

Re comment #9: the bug, as reported, occurs with userpriv AND usersandbox, that it works with userpriv only is true, but it doesn't say anything about userpriv+usersandbox.

Re #10: I assume the original poster did set CCACHE_DIR correctly, as I did. "CCACHE_DIR=/var/tmp/ccache ccache -s" reports state of Portage's ccache directory and it shows that the cache is not used. Inspecting the directory 'manually' reveals it's indeed true.

Can this bug please be reopened (and ideally fixed)?
Comment 12 Joël 2005-03-31 11:11:55 UTC
I can confirm the comment #11, and indeed, the "chown -R" fix works.

Please reopen...