Re: Squid 3.2 Cannot bind socket

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Sun, 28 Nov 2010 10:14:34 -0700

On 11/26/2010 12:36 AM, Jean-Philippe Menil wrote:
> Le 26/11/2010 06:51, Jean-Philippe Menil a écrit :
>> Hi,
>>
>> i recently installed squid 3.2 with "workers 2".
>> However, i see the following in the cache.log:
>>
>> 2010/11/23 16:10:49 kid1| Ready to serve requests.
>> 2010/11/23 16:10:49 kid1| commBind: Cannot bind socket FD 12 to [::]:
>> (2) No such file or directory
>> 2010/11/23 16:10:49 kid3| Loaded Icons.
>> 2010/11/23 16:10:49 kid3| Squid modules loaded: 0
>> 2010/11/23 16:10:49 kid3| Adaptation support is off.
>> 2010/11/23 16:10:49 kid3| Ready to serve requests.
>> 2010/11/23 16:10:49 kid3| commBind: Cannot bind socket FD 10 to [::]:
>> (2) No such file or directory
>>
>> First, i think it was related to ipv6, but after recompiling squid with
>> "--disable-ipv6", i observe the same error.

> it seems not related to ipv6 afteward.
>
> In the suqid.conf, if i had the following:
>
> if ${process_name} = 1
> http_port 3129
> endif
>
> if ${process_name} = 2
> http_port 3130
> endif
>
> Squid odes not start:
>
> Starting Squid HTTP Proxy 3.x: squid3Creating Squid HTTP Proxy 3.x cache
> structure ... (warning).
> FATAL: String is not a integer number: 'squid'

This failure is expected, for the reported reason.

> But if i had the following otpions:
>
> if ${process_number} = 1
> http_port 3129
> endif
>
> if ${process_number} = 2
> http_port 3130
> endif
>
>
> Squid is starting with the following logs:
>
> 2010/11/26 07:32:06 kid3| Took 0.00 seconds ( 0.00 entries/sec).
> FATAL: No port defined

This one looks like a Squid bug. The coordinator process (kid3 if you
have two workers) quits because it does not have an http_port number
specified. However, the coordinator process does not need and does not
use http_ports! We will remove the unneeded check for the coordinator.

Meanwhile, please add an http_port line for coordinator or, better, use
an else syntax:

     if ${process_number} = 1
     http_port 3129
     else
     http_port 3130
     endif

Another option is to use process number of the port itself and avoid all
conditionals. For example,

     http_port 313${process_number}

Needless to say, this last approach would require appropriate changes in
your network and/or client configuration.

HTH,

Alex.
Received on Sun Nov 28 2010 - 17:14:51 MST

This archive was generated by hypermail 2.2.0 : Tue Nov 30 2010 - 12:00:05 MST