Markus wrote a patch for portage (based on 2.0.49-r4) to extend Portage's functionality for distcc. My plans for distcc are to further integrate Portage and Distcc so the user doesn't have to do any extra setup, aside from setting the hosts. To wit, the patch necessitates changes to /etc/make.globals to add: # Define DISTCC_DIR - a place to place distcc state files # /var/tmp/portage/.distcc is ideal default DISTCC_DIR="${PORTAGE_TMPDIR}/portage/.distcc" And the patch is applied to portage.py. This is marked as "major" since I'm waiting on this to be put into ~x86 to release distcc 2.10.1 (and soon to be 2.10.2) and a bump is made to 2.10-r3 to stable. I'm CCing Markus since he wrote the patch. =)
Created attachment 18012 [details, diff] Patch for Portage.py
Created attachment 18018 [details, diff] Patch for portage.py cleaned it up a bit.
*** Bug 28411 has been marked as a duplicate of this bug. ***
Why do you make the directory setuid???
It shouldn't be. Markus, can you fix it, make it 0644?
Created attachment 18061 [details, diff] Patch for portage.py Don't ask my what i were thinking about.
BTW, Something in Portage is invoking gcc first and putting a file in /var/tmp/portage/.distcc/lock. This is causing problems with distcc (permission denied), since the lock file is created by root.
The directories should have mode 0755, or perhaps 02755. Directories with mode 0644 are not executable and therefore nobody can access files which are inside them. Just to recap: setgid on a directory means newly created children have the same gid as the directory, not the parent that created them. setuid on a directory makes people scratch their heads. :-) read bit on a directory gives permission to list it. execute bit gives permission to open files in the directory. Lisa's assessment that somebody is creating a lock file in there by running as a different user is probably correct. That's probably a bad thing for portage to do, and I think you should investigate it. However, distcc should perhaps try to be more forgiving of different users sharing a directory. I will think about what can be done there.
Created attachment 18148 [details, diff] Fixed, as per Martin's suggested 02755 mode. This patch along with the patch in bug 29313, and adding DISTCC_DIR="${PORTAGE_TMPDIR}"/portage/.distcc to /etc/make.globals will integrate distcc with Portage. The user will just have to emerge distcc, put distcc in FEATURES and set hosts. No more funky DISTCC_HOSTS setting in env files or make.conf.
Default is handled in ebuild.sh. make.conf is for user changes.