Unix/Gentoo

Running distccd server from other Linux distros

ForceCore 2011. 3. 2. 23:51
I have an ArchLinux box and I tried to run distccd. However, it was found out that Arch's distccd could not handle request from Gentoo box. Virtual machines worked but they were an overkill for this job. Currently I'm using chrooted environment to run Gentoo's GCC tool chain. These instructions should work on Ubuntu boxes as well.

The trick is to download gentoo stage 3 tarball and portage snapshot and follow the installation handbook upto the point where you can begin emerging. You don't need the live CD environment, but follow the instructions in your Linux box.

1. Untar the stage tarball to your Linux box. In my case, /usr/local/distcc-gentoo (Instead of /mnt/gentoo suggest by the installation handbook.)

2. Do that /dev and /proc mount thingy.

3. Chroot to /usr/local/distcc-gentoo

4. Untar gentoo portage as you normally would.

5. Sync the portage so that you can begin emerging.

6. http://www.gentoo.org/doc/en/distcc.xml#bootstrapping Follow the instructions for using distcc for bootstrapping. If you emerge without --nodeps flag, many other unnecessary dependencies would emerge.

7. At this point you can invoke (chrooted)/etc/init.d/distccd. However, you have to tweak it a little bit so that it will not try to load other filesystem and network services, which are already managed by the non-gentoo kernel:

/usr/local/distcc-gentoo/etc/init.d/distccd
#!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-devel/distcc/files/3.1/init,v 1.1 2009/03/19 17:56:09 matsuu Exp $

depend() {
#   need net
    use avahi-daemon ypbind
}

start() {
    ebegin "Starting distccd"

I've commented "need net" dependency. If you encounter other service dependency related problems, do similar modifications.

8. This is it! The daemon should be running. For other configurations, refer Gentoo documentation.