Disable tcp_cork_sock warnings when using distcc over ssh

So, first blog entry, a milestone!  One that will never, ever be achieved again.  So, it begins…

I am using distcc over ssh to compile source code and have been getting the following distracting warning messages:

distccd[4542] (tcp_cork_sock) Warning: setsockopt(corked=1) failed: Socket operation on non-socket

The warnings can be prevented by setting the environment variable DISTCC_TCP_CORK=“0” on the server.  However, it’s not enough to add this to your shell’s startup script on each server.  The client is remotely executing the command ‘distccd’, so files like .bash_profile are never read.  There are a couple options that will either set an system-wide environment variable on the server or make sure it’s pushed over from the client:

  • Setting DISTCC_TCP_CORK in /etc/environment on the server [1]
  • Setting DISTCC_TCP_CORK in your shell’s startup script, followed by using SendEnv and AcceptEnv in ~/.ssh/config and /etc/ssh/sshd_config on the client and server respectively
  • Setting DISTCC_TCP_CORK in ~/.ssh/environment client side and using PermitUserEnvironment in /etc/ssh/sshd_config server side [1]

The first is the least amount of work, but all three will require root privileges on the server side if you have to change anything.  The end result, no more tcp_cork_sock warnings from distccd!  However, after reading through distcc’s manpage, I’m still curious to know what sort of performance hit, if any, is incurred from disabling TCP corks.

[1] http://www.raphink.info/2008/09/forcing-environment-in-ssh.html
[2] http://forums.gentoo.org/viewtopic-t-811165-start-0.html


About Jeffrey Wildman

I'm an electrical engineering graduate student studying communication networks at Drexel University in Philadelphia, PA. My hobbies include programming, linux, computer games, and soccer.
This entry was posted in Linux, Programming. Bookmark the permalink.

One Response to Disable tcp_cork_sock warnings when using distcc over ssh

  1. ponens says:

    I just inserted the line in my .bashrc on the server and it works! So I think it is heavily depends on the server configuration.

    P.S. I have no root on this server

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s