After upgrading portage to 2.0.51.22-r1 it sets the permissions on /var/tmp/ccache every time portage runs. I let it run completely once (which took an aweful long time), and though it would be fixed. The files have permission 664 and owner root:portage. The directories have permission 2775 and owner root:portage. Each time I run an emerge command (eg emerge world -u) portage decides to reset all the permissions in this folder (even though they are set just fine). If I disable FEATURES="ccache" in make.conf the problem goes away (although ccache is not used). Reproducible: Always Steps to Reproduce: 1. set FEATURES="ccache" in /etc/make.conf 2. emerge foo Actual Results: * Adjusting permissions on ccache in /var/tmp/ccache Expected Results: Skip this step and continue with emerge Portage 2.0.51.22-r1 (default-linux/x86/2005.0, gcc-3.3.5-20050130, glibc-2.3.4.20041102-r1, 2.6.11-gentoo-r9 i686) ================================================================= System uname: 2.6.11-gentoo-r9 i686 Pentium III (Coppermine) Gentoo Base System version 1.6.12 ccache version 2.3 [enabled] dev-lang/python: 2.3.5 sys-apps/sandbox: 1.2.10 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5 sys-devel/binutils: 2.15.92.0.2-r10 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O3 -march=i686 -pipe -mcpu=i686 -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/bind /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O3 -march=i686 -pipe -mcpu=i686 -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks sandbox sfperms strict" GENTOO_MIRRORS="ftp://mirror.pacific.net.au/linux/Gentoo ftp://mirror.isp.net.au/pub/gentoo/ http://mirror.isp.net.au/pub/gentoo/ ftp://gentoo.mirrors.pair.com/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="3dnow aac acl alsa apache2 apm arts authdaemond avi bash-completion berkdb bitmap-fonts crypt cscope cups curl dedicated dio divx4linux doc emboss encode fam flac foomaticcdb foomaticdb fortran gdbm gif gpm gtk2 imap imlib jpeg libclamav libg++ libwww mad mailwrapper mikmod mmx motif mp3 mpeg mysql ncurses nls nptl oggvorbis opengl oss pam pdflib perl png ppds python quicktime readline samba sasl sdl spell sse ssl tcpd tiff truetype truetype-fonts type1-fonts usb x86 xml2 xmms xv xvid zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Is /var/tmp/ccache mounted separately? It should only change if you switch between FEATURES="userpriv" and "-userpriv". What are the permissions on /var/tmp/ccache?
/var is part of the root directory I've never touched the 'userpriv' feature Permissions are 644 for files and 2775 for directories, with root:portage as the owner for everything.
If /var/tmp/portage is root:portage and g+sxrw it shouldn't happen. Can you run the following and paste the output please? python -c 'import os; print os.stat("/var/tmp/ccache")'
(17904, 233949L, 771L, 18, 0, 250, 752L, 1105753715, 1121424017, 1121424017)
Does ls -ld /var/tmp/ccache give drwxrwSr-x or drwxrwsr-x? If it's the former, that's the problem. Run chmod 2775 /var/tmp/ccache and that'll fix it. I've worked up a patch to fix it, but still need to test. If you're keen, change lines 2532 and 2539 from g+s to g+sx.
/var/tmp/ccache itself was set drwxrwS--- after changing it to drwxrwsr-x the problem goes away. Good work Jason!
I have det same problem. Furthermore the command: ccache -s shows only zeros. The permissions on /var/tmp/ccache are: drwxrwsr-x 18 root portage 456 Sep 22 11:12 ccache Emerge info: Portage 2.0.51.22-r2 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.5-r1, 2.6.12-gentoo-r9 i686) ================================================================= System uname: 2.6.12-gentoo-r9 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz Gentoo Base System version 1.6.13 ccache version 2.3 [enabled] dev-lang/python: 2.3.5 sys-apps/sandbox: 1.2.11 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6 sys-devel/binutils: 2.15.92.0.2-r10 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=pentium4 -O2 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks sandbox sfperms strict" GENTOO_MIRRORS="ftp://ftp.gentoo.diku.dk/ http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" USE="x86 X alsa apm avi bash-completion berkdb bitmap-fonts cdr crypt curl eds emacs emboss encode fortran gdbm gif gpm gstreamer gtk gtk2 imagemagick imlib ipv6 jpeg libg++ libwww mad mikmod motif mp3 mpeg ncurses nls ogg oggvorbis opengl oss pam pdflib perl png python quicktime readline sdl sse ssl tcpd tetex tiff truetype truetype-fonts type1-fonts vorbis xine xml2 xmms xv zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
I can confirm that portage sets permissions every time you run it. I first noticed the problem when I ran the ccache stats command to make sure it was working: # ccache -s cache hit 0 cache miss 0 files in cache 0 cache size 0 Kbytes max cache size 1024.0 Mbytes This info conflicts with the directory info, as I have tried emerging a few things to see if it works.... # du -sh /var/tmp/ccache 12M /var/tmp/ccache ... And it grows with every emerge. So I'd have to assume portage is using it, it has just broken ccache stats, probably via permissions. When I tried to adjust permissions per what gentoo-wiki.com suggested, Portage had none of it and reset permissions before emerging. Here is my emerge --info: Portage 2.0.51.22-r2 (default-linux/x86/2005.1, gcc-3.3.6, glibc-2.3.5-r1, 2.6.12-gentoo-r6 i686) ================================================================= System uname: 2.6.12-gentoo-r6 i686 Pentium III (Coppermine) Gentoo Base System version 1.6.13 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.3 [enabled] dev-lang/python: 2.3.5-r2 sys-apps/sandbox: 1.2.12 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6 sys-devel/binutils: 2.15.92.0.2-r10 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O2 -march=i686" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O2 -march=i686" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks sandbox sfperms strict" GENTOO_MIRRORS="ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 X aim alsa apm arts avi berkdb bitmap-fonts bzip2 bzlib clamav codecs crypt cups curl dhcp divx4linux dvd dvdread eds emboss encode esd etherreal fam foomaticdb fortran freetype gdbm gif gimp gkrellm gnome gpm gstreamer gtk gtk2 icq imlib ipv6 java jpeg junit kde kdeenablefinal libclamav libg++ libwww live mad mikmod mmx motif mozilla mp3 mpeg mplayer msn ncurses nls offensive ogg oggvorbis opengl oss pam pcmcia pdf pdflib perl png python qt quicktime rar readline sdl spell sse ssl svg tcpd tiff truetype truetype-fonts type1-fonts usb vorbis wifi xml2 xmms xv xvid yahoo zlib userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
I can as an addition to my post confirm #8 in that it is only the stats that seem not to work as the /var/tmp/ccache directory grows with each emerge.
For stats for the cache in this directory you have to set CCACHE_DIR: CCACHE_DIR="/var/tmp/ccache" ccache -s
Should that variable not be exported automatically if you have commented in features="ccache" in your /etc/make.conf?
It will be set inside the portage environment, but not in the user environment.
Well this bug can be closed then. I have made a new bug report: http://bugs.gentoo.org/show_bug.cgi?id=107381 Requesting a change in the handbooks talk about ccache: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=3#doc_chap3 A questing remains. When did the CCACHE_DIR stop being a global environment variable. I remember that at one point that I did not have to have CCACHE_DIR="/var/tmp/ccache" in front of the ccache -s command
Fixed in 2.0.53