Closed bluesun08 closed 8 years ago
In general, this is not an appropriate question for dports issues -- better the user list, etc. However, you are in luck. According to google, somebody had this exact issue on DragonFly and it's been solved:
well, hold on, let me read this further
This seems to need a patch to be ideally fixed, but venk's response got somebody going:
"Some workarounds -- patch squid to create its shm file in /tmp/≤...> or some other common path; or if the shm segment is opened w/o O_EXCL and you don't mind a file in /, create it manually and set permissions so squid can read/write it."
I'll leave the issue open to remind me to patch this (or figure out what's going on with FreeBSD -- why they don't have the same issue)
does "/var/run/squid" exist on your machine?
I suspect it is not, and it's failing because this directory is missing. It should be using this location, not "/"
I opened a PR on this, I think I know the cause but not why it's set up this way:
I created "/var/run/squid" (chmod 777) and get the same error message. Now i'm completely confused. What is the solution?
By the way 1: I wonder why the often used "squid"-daemon don't run correctly under a server operating system.
By the way 2: My experience is, if i post this in a user list i will get the info: please post it in dports.
well, I initially thought this was "how do I run the software" question, but it's seems more like an issue suitable for this list now.
The original suggestion was to precreate the file that's missing with easy permissions but that seems like a hack to me.
I think the code I published is what is responsible, but precreating /var/run/squid should have worked.
seems that shm_portable_segment_name_is_path is not supported on DragonFly
ok. so how can i get run squid?
you have to wait until this is sorted out.
or pre-create the filename in root
pre-create the filename in root? Can you give me detailed instructions?
If I post a post, can you add it to "files" and rebuild squid to test?
post a *patch
if you want to download this patch, put it in www/squid/files and rebuild squid, the patch is here: http://leaf.dragonflybsd.org/~marino/patch-compat_shm.cc
if it works, we'll have to update the port at some level.
now it works! thank you - i love you :-)
Did it write to /var/run/squid ?
yep
ok. So we still need to modify the port to create that directory by default (in addition to the patch)
fyi, squid 3.5.6 is in dports now if you want to pull it and build it. (new version)
i need squid to run on port 80. google says that in this case squid have to run as user root. how can i run squid as root?
If this is an "how do I use this software?" question, it's not appropriate for "DPorts Issues". If there is a problem with the port that prevents the s/w (squid) from running correctly, it is appropriate.
So is there an actual issue with the port preventing normal use?
ok, let me go in detail:
i write " squid_user="root" " in /etc/rc.conf. If then i try to start squid there is the following error message: "squid: Ipc::Mem::Segment::create failed to shm_open(/var/run/squid/cf__metadata.shm): (13) Permission denied"
so i think it is a dports problem.
How about more detail? for example, does /var/run/squid/cf__metadata.shm already exist? if so, what are file permissions? Maybe it exists and it's write only.
why would something work as a normal user and not as root?
Please have a look at my initial post. The same error message again ...
not, it is not the same message.
You are misleading any diagnosis by suggesting a fixed problem has returned.
Note "/" vs "/var/run/squid". That's a big difference.
Plus, you didn't answer my questions. I have other things to do esp. if you are holding back on details and thinking my questions are rhetorical.
:-) It seems to me that "/var/run/squid/cfmetadata.shm" is created while starting squid. if squid_user="squid" then squid starts and /var/run/squid/cf__metadata.shm exists if squid_user="root" then squid don't start (see error message above) and /var/run/squid/cfmetadata.shm don't exist The directory permissions of /var/run/squid are 777.
I agree with you: why would something work as a normal user and not as root? So i think this is a bug.
try opening a PR at https://bugs.freebsd.org/bugzilla/ put "www/squid : " at the beginning on the title. The maintainer is good guy and dragonfly-friendly. He'll probably be able to figure this out quickly. Remind him of shm patch for dragonfly as a hint. I just have no time at the moment.
Thank you! But i'll wait until you're less busy.
well, it's also the correct thing to do. He's the maintainer. I just get these building, but any advanced problems really needs to go to maintain unless they refuse to support dragonfly
I'm going to close this unless new information comes that illustrates this as a build problem (vs something suitable for FreeBSD bugzilla report)
I run Dfly 4.3. After installing Squid via Dports and "squid -z" i get the following error:
FATAL: Ipc::Mem::Segment::create failed to shm_open(/squid-cf__metadata.shm): (13) Permission denied
What goes wrong?