[squid-users] Error starting 3.5.16 on FreeBSD-8.4

Alex Rousskov rousskov at measurement-factory.com
Thu Apr 7 16:35:45 UTC 2016


On 04/07/2016 08:21 AM, Odhiambo Washington wrote:

> On 7 April 2016 at 17:16, Amos Jeffries wrote:
> 
>     On 7/04/2016 3:16 a.m., Odhiambo Washington wrote:
>     > I am getting the following error in cache.log:
>     >
>     > Squid Cache (Version 3.5.16): Terminated abnormally.
>     > FATAL: Ipc::Mem::Segment::create failed to
>     > shm_open(/opt/squid-3.5/var/run/squid/cf__metadata.shm): (17) File exists
>     >
>     > However, that file doesn't exist.

>     This can happen if you have a startup script the runs 'squid -z' or
>     similar just prior to starting the main proxy, and not waiting
>     sufficiently long for the -z run to finish.


> I am gonna check this out again tonight although I doubt if that is the
> cause.
> 
> I run squid using daemontools, invoked as:
> 
> exec setuidgid root /opt/squid-3.5/sbin/squid -f
> /opt/squid-3.5/etc/squid.conf -N
> 
> /opt/squid-3.5/var/run/squid/ is actually empty when I get this error.


I see two possibilities:

1. The file was there at the time the error was triggered but was not
there at the time you checked the directory. This would mean that
something is starting a second Squid while the first Squid has not
removed the shared memory segment file (yet). Amos mentioned one such
common scenario (not waiting for background squid-z) but there are
others, possibly including handling of Squid crashes. Do you see any
other errors, assertions, or FATAL messages in your cache.log?

2. Squid code that is trying to open the shared segment is broken or,
more likely, not compatible with your FreeBSD environment. For example,
it tries to exclusively create a shared segment using the wrong name.

If you can reproduce this, I recommend starting Squid via strace (or
equivalent) to see the system calls that Squid is making when calling
shm_open() and the exact call parameters. This can confirm or eliminate
#2 as the suspect.


HTH,

Alex.



More information about the squid-users mailing list