Squid Proxy Server Error : Upon Starting

You've run squid with the wrong user, which created files with wrong permissions.

squid: ERROR: Could not read pid file

You need to run with sudo: sudo squid -z.

fatal: ipc::mem::segment::create failed to shm_open(/squid-cf__metadata.shm): 13 permission denied

You need to remove Squid's .shm files from /dev/shm or assign the right permissions.

$ sudo rm -v /dev/shm/squid*.shm

Also make sure that:

  • Squid's log dir (/var/log/squid?) is owned by the right user (proxy?).
  • Squid's cache dir (/var/spool/squid?) is owned by the right user.

For the full example, check the following Docker container at sameersbn/docker-squid.