[distcc] Distributed compiling

Martin Pool mbp at sourcefrog.net
Thu Jan 19 09:03:20 GMT 2006


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.)

-- 
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/distcc/attachments/20060119/6b9ac153/attachment-0001.bin


More information about the distcc mailing list