1

I got this error upon starting Squid Proxy Server using the command sudo squid -z

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

How shall I fix it? Im using version 3.5.26 of Squid. I tried implementing the fix below I found in the web:

 Just add the following line to your /etc/fstab file: 
 shm /dev/shm tmpfs nodev,nosuid,noexec 0 0 
 After that use (as root): 
 # mount shm 

Unfortunately, it doesn't work. Another possible fix on the web is error reading squid.pid

 squid: ERROR: Could not read pid file
 /var/run/squid.pid: (13) Permission denied

Unfortunately, as I look in my directory, I could not find squid.pid. How will I get my Squid working? Thanks.

  • Are you running apache or Zabbix in that server? – Rui F Ribeiro Mar 29 at 4:23
  • @RuiFRibeiro -> I don't have any. I think should have installed Apache. – Alyssa Gono Mar 29 at 4:42
1

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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.