Next Previous Contents

4. The distccd Server

The distccd server may be started either from a super-server such as inetd, or as a stand-alone daemon.

distccd does not need to run as root and should not.

distccd does not have a configuration file; it's behaviour is controlled only by command-line options and requests from clients.

4.1 Invoking distccd

These options may be used for either inetd or standalone mode.

If you want to see if the daemon started properly, look in the log file. By default this is something like /var/log/daemon or /var/log/messages, depending on your system.

--help

Explains usage of the daemon and exits.

--version

Shows the daemon version and exits.

-N, --nice NICENESS

Makes the daemon more nice about giving up the CPU to other tasks on the machine. NICENESS is a value from 0 (regular priority) to 20 (lowest priority). This option is good if you want to run distccd in the background on a machine used for other purposes.

-p, --port PORT

Set the TCP port to listen on. (Standalone mode only.)

--listen ADDRESS

Instructs the distccd daemon to listen on the IP address ADDRESS. This can be useful for access control on dual-homed hosts.

-P, --pid-file FILE

Save daemon process id to file FILE.

--user USER

If distccd gets executed as root, change to user USER.

-a, --allow IPADDR[/MASK]

Instructs distccd to only accepts connections from the IP address IPADDR. A subnet mask can be supplied optionally after a trailing slash, e.g. 192.168.0.0/24.

--verbose

Include debug messages in log.

--no-detach

Do not detach from the shell that started the daemon. This may be useful when running distccd from a system such as daemontools that manages daemons after they start.

--no-fork

Don't fork children for each connection, to allow attaching gdb. Don't use this if you don't understand it!

--no-fifo

Send input to the compiler by writing to a temporary file, rather than using a pipe. This is required when the server's temporary directory is on NFS, on at least some machines. It may be faster in some circumstances, but probably is not.

--log-file=FILE

Send messages to file FILE instead of syslog. Logging directly to a file is significantly faster than going via syslog and is recommended.

--log-stderr

Send log messages to stderr, rather than to a file or syslog. This is mainly intended for use in debugging.

--inetd

Serve a client connected to stdin/stdout. As the name suggests, this option should be used when distccd is run from within a super-server like inetd. distccd assumes inetd mode when stdin is a socket.

--daemon

Bind and listen on a socket, rather than running from inetd. This is used for standalone mode. distccd assumes daemon mode at startup if stdin is a tty, so --daemon should be explicitly specified when starting distccd from a script or in a non-interactive ssh connection.

4.2 distccd Exit Codes

As for distcc exit .

4.3 distccd Environment Variables

DISTCC_SAVE_TEMPS

If set to 1, temporary files are not deleted after use. Good for debugging or if your disks are too empty.

Note that DISTCC_LOG does not affect the log destination for the server.

4.4 Terminating distccd

To shut down the server, send a SIGTERM signal to the parent process. The most reliable way to do this from a script is to use the --pid-file option to record its process ID.

Shutting down the server may interrupt any compilation jobs which are in progress and cause warnings on any clients that are using the server. The client will reissue the jobs, so shutting down the server should not cause a build to fail.


Next Previous Contents