Strangely enough, it appears that Squid cannot start if the squid user is not affected to the UID 100. When trying to use another PID, the service systematically fails to start with the following error:
2016/03/10 10:53:13| storeDirWriteCleanLogs: Starting...
2016/03/10 10:53:13| Finished. Wrote 0 entries.
2016/03/10 10:53:13| Took 0.00 seconds ( 0.00 entries/sec).
FATAL: Ipc::Mem::Segment::create failed to shm_open(/squid-cf__metadata.shm): (17) File exists
Squid Cache (Version 3.5.15): Terminated abnormally.
CPU Usage: 0.026 seconds = 0.026 user + 0.000 sys
Maximum Resident Size: 48640 KB
Page faults with physical i/o: 0
Here is how I usually proceed to change a service PID:
vi /etc/groupto change service's GID:Before:
squid:*:100:After:
squid:*:1234:vipwto change the service UID:Before:
squid:*:100:100::0:0:squid caching-proxy pseudo user:/var/squid:/usr/sbin/nologinAfter:
squid:*:1234:1234::0:0:squid caching-proxy pseudo user:/var/squid:/usr/sbin/nologinRestore files ownership using the two following commands:
find / -uid 100 -exec chown -v squid {} + find / -gid 100 -exec chgrp -v squid {} +
I'm installing Squid in a FreeBSD jail managed with ezjail.
I've thought about IPC's but did not found any IPC using ipcs -a when Squid is running properly.
I've also tried, in a new clean jail, to first create the squid user with a custom UID and then install the squid package to ensure that the right UID is used right from the beginning and no squid user with PID 100 existed at any time, but same issue (I also conclude from this that this issue cannot come from an ownership issue). Setting the UID to 100 make Squid able to boot.
I tried several PID (including lower ones like 101), all of them show the same behavior.
I've also tried to play with the squid_user parameter in rc.conf but with no luck: setting it to either squid or root does not seem to change anything.
I've another jail on the same system with a Squid running with PID 100, but shutting it down did not change the issue in any way (in all cases I would be highly surprised by a interference between two jails).