[distcc] More masquerade questions vs shell scripting?

Wayne Davison wayned at users.sourceforge.net
Sun Mar 30 08:15:38 GMT 2003


On Sat, Mar 29, 2003 at 03:38:15PM -0600, Bob Tanner wrote:
> #!/bin/bash
> exec /usr/bin/ccache /usr/bin/distcc /usr/bin/gcc $*

Some differences between this shell script and masquerade mode:

 - Masquerade saves the extra exec of the shell, making it slightly more
   efficient for each call to gcc.

 - The above command only works if all the distccd machines have gcc in
   /usr/bin.  Masquerade mode works no matter where gcc is on the server
   hosts (it just has to be on the PATH when distccd was started).

 - The above shell script will fail if any args have spaces in them:
   you should be using "$@" (with the quotes), not $* (a very common
   mistake when creating a wrapper shell script).

 - To customize what programs to run (i.e. if you want to temporarily
   leave out distcc or ccache, or add colorgcc), you have to create a
   customized shell script for each option.  (The best solution is
   probably for each user to put their own shell script into a personal
   ~/bin dir and customize it.)  With masquerade mode, you just tweak
   the PATH and compile, making it easier to setup and customize
   (especially in scripts).

So, no Earth-shattering differences (especially if you fix the shell bug
as mentioned above), but masquerade is a more universally compatible and
slightly more optimal solution, so using it seems like the better choice
in the long run.

..wayne..


More information about the distcc mailing list