*BSDThis forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Tried to post this on the squid-cache list but for some reason I get no reply to my subscribe messages on that list so figured I'd try it here:
OK This isn’t mentioned in the SQUID FAQ. I do see several postings of similar questions in their archives but none show a final solution.
Most answers say “check your permissions” (well duh!). So before anyone says that let me state I HAVE checked my permissions.
The full sequence of messages in syslog:
May 16 09:49:15 nighthawk squid[24523]: Squid Parent: child process 24590 started
May 16 09:49:15 nighthawk (squid): Cannot open '/usr/local/squid/logs/access.log' for writing. The parent directory must be writeable by the user 'nobody', which is the cache_effective_user set in squid.conf.
May 16 09:49:15 nighthawk /kernel: pid 24590 (squid), uid 3128: exited on signal 6 May 16 09:49:15 nighthawk squid[24523]: Squid Parent: child process 24590 exited due to signal 6 May 16 09:49:15 nighthawk squid[24523]: Exiting due to repeated, frequent failures
This is on FreeBSD 4.8 system. It hadn’t been booted for some time and recently was. Also the kernel was recompiled just to experiment with doing same as we needed to do this on another system to enable a SMP. However after the recompile the kernel config was reverted and recompiled again so should be the same as it was before (except for date of creation). I tested booting from the original kernel to see if that helped since it was the only change made to the system but it didn't help.
To test whether “nobody” could access the “parent directory” I did:
su –m nobody
cd /usr/local/squid
touch jcltest
ls –l jcltest
rm jcltest
cd /usr/local/squid/logs
touch jcltest
ls –l jcltest
rm jcltest
cp –p access.log access.log.old
echo hello >access.log #File was 0 bytes before this cat access.log cp –p access.log.old access.log.old
Above tests confirmed I could “write” a new file called jcltest into the “parent directory” as user “nobody” and also into the parent of the parent directory. It also confirmed I was able specifically to write into the file “access.log” as the user “nobody”. Obviously this is not a permission issue.
I also tried moving access.log to access.log.old to see if it wanted to create the file on startup but got the same error.
Any ideas? This seems to have been a problem many times but no one has ever posted a solution.
You've demonstrated that the user nobody can write to the directories involved, as well as to the log. The squid log indicates that this is the problem. However, it might not be the real problem. The error message might simply be indicating the most common cause of the problem at hand.
What user actually owns access.log? It might be that squid requires the file to not just be writable, but actually owned, by cache_effective_user. Do you have squid itself running as the user nobody?
The file and the directory are owned by "nobody" which is the cache effective user in squid.conf. As mentioned I hadn't made any change to the squid configuration.
Is there a greater level of debugging I could enable that would tell me what the problem really is rather than having it guess the most common cause?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.