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

Alex Rousskov rousskov at measurement-factory.com
Thu Apr 7 19:57:57 UTC 2016


On 04/07/2016 12:21 PM, Odhiambo Washington wrote:
> 
> 
> On 7 April 2016 at 19:35, Alex Rousskov
> <rousskov at measurement-factory.com
> <mailto:rousskov at measurement-factory.com>> wrote:
> 
>     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.


3. The error reported by Squid is bogus. Squid has lots of code that
corrupts/overwrites the error number before actually reporting the
system call error...



> All I get from running strace -ff -vvv -o /tmp/squid-strace.txt
> /opt/squid-3.5/sbin/squid -f /opt/squid-3.5/etc/squid.conf:
> ..
> pread: Device busy
> pread: Device busy
> pread: Device busy
> pread: Device busy
> pread: Device busy
> pread: Device busy
> pread: Device busy
> pread: Device busy
> pread: Device busy
> pread: Device busy
> pread: Device busy
> pread: Device busy
> PIOCRUN: Input/output error
> trouble opening proc file 

The above does not look like strace output I am used to [on Linux], but
I cannot help you with making strace work. There may be a better tool on
FreeBSD. Hopefully, somebody else will tell you how to get the necessary
info on FreeBSD.

Alex.



More information about the squid-users mailing list