[distcc] Distributed compiling

Victor Norman vtnpgh at yahoo.com
Thu Jan 19 14:47:27 GMT 2006


My DMUCS project contains a script that does this: watch-ssaver.  It is a very short script, so here it is:


my $numArgs = @ARGV;
my $host = "";

if ($numArgs == 1) {
    $host = $ARGV[0];

my $blanked = 0;
open (IN, "xscreensaver-command -watch |");
while (<IN>) {
    if (m/^(BLANK|LOCK)/) {
    if (!$blanked) {
        if ($host == "") {
        } else {
        system("/us/bfsbld/Compilers/distcc/bin/enable-host $host");
        $blanked = 1;
    } elsif (m/^UNBLANK/) {
    if ($host == "") {
    } else {
        system("/us/bfsbld/Compilers/distcc/bin/disable-host $host");
    $blanked = 0;

I got this off the internet from somewhere and modified it to run my enable-host and disable-host commands. The enable-host command just starts up the distcc daemons on the machine and starts up my loadavg command.  Thus, the machine is added to the dmucs server and becomes part of the compilation farm.  When the screensaver exits, the disable-host command runs, which removes the desktop machine from the compilation farm.

We've used it here at Marconi for a long time, and it works great.

(NOTE: I never have found a way to do this with Windoze/Cygwin, but I sure would like to find one.)

Check out http://sourceforge.net/projects/dmucs for dmucs -- you can look at the source code, etc., with CVS too.  And, I have alot of info about how dmucs works, etc., on the Home Page -- accessible from the above URL.  And, I'd be happy to help you set up dmucs in your system, if you need help.


Patrik Olesen <patrik at famolesen.com> wrote:           Could it not be enough to just use nice?
 / Patrik
 Martin Pool wrote:    
On 19 Jan 2006, "Bryntse, Mats" <Mats.Bryntse.x at sonyericsson.com> wrote:
Thanks for your answers!

I guess what I'm looking for is something that will only allow this
program to run computers where the screensaver is enabled. Thus never
stealing any CPU from someone working on their computer...

Is there such a patch?
 I don't know of such a thing.  It should not be awfully hard.  'xscreensaver-command -watch' or 'xscreensaver-command -time' will give you some useful information on whether or when the screen was locked/blanked.  It should be fairly easy for a shell script to read this and activate or deactivate distccd.    This could run as the logged-in user, or as a system process owned by root.  If run by root, it needs to know which displays might have someone logged in, but for workstations you can start by assuming that's always just :0.0.  The basic approach is shown in the attached shellscript from Ubuntu that turns off the screensaver when the laptop lid is closed.  (Obviously in this case xscreenaver would be the controlling not the controlled object.)  I'm not sure of a way to tell if the user is active if they're not running xscreensaver but it's possible it's advertised on DBus on gnome machines.  Another approach would be to actually write a screenaver that runs distccd, and perhaps
 even displays on the screen what it's being used for.  (This assumes you're using some kind of x11 unix; on windows or os x there should be equivalent mechanisms.)    

 __  distcc mailing list            http://distcc.samba.org/ To unsubscribe or change options:  https://lists.samba.org/mailman/listinfo/distcc
distcc mailing list            http://distcc.samba.org/
To unsubscribe or change options: 

Yahoo! Photos
 Got holiday prints? See all the ways to get quality prints in your hands ASAP.
-------------- next part --------------
HTML attachment scrubbed and removed

More information about the distcc mailing list