Operating System - Linux
1752685 Members
5332 Online
108789 Solutions
New Discussion юеВ

cache.log only contains "Failed to create...Permission denied"

 
SOLVED
Go to solution
Maaz
Valued Contributor

cache.log only contains "Failed to create...Permission denied"

# /usr/local/squid/sbin/squid -v
Squid Cache: Version 2.6.STABLE12
configure options: '--prefix=/usr/local/squid' '--enable-snmp' '--enable-delay-pools'


# ls -ld /opt/cache/squid
drwxrwxr-x 18 squid nobody 464 Jul 30 15:13 /opt/cache/squid

# ls -l /opt/cache/squid
total 276
drwxr-x--- 258 squid nobody 6192 Apr 16 16:30 00
drwxr-x--- 258 squid nobody 6192 Apr 16 16:30 01
drwxr-x--- 258 squid nobody 6192 Apr 16 16:30 02
drwxr-x--- 258 squid nobody 6192 Apr 16 16:30 03
.
.
.
.


# cat /usr/local/squid/var/logs/cache.log
2007/07/30 11:21:59| storeUfsCreate: Failed to create /opt/cache/squid/00/1D/00001D92 ((13) Permission denied)
.
.
.
cache.log contains such type of messages.. any thing wrong ?

Regards
Maaz
5 REPLIES 5
Vitaly Karasik_1
Honored Contributor
Solution

Re: cache.log only contains "Failed to create...Permission denied"

can you re-check (ps -ef|grep squid, for example) that squid runs under squid user?
Ivan Ferreira
Honored Contributor

Re: cache.log only contains "Failed to create...Permission denied"

Try stopping squid, then:

chown -R squid /opt/cache/squid
squid -z

Start squid again.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Maaz
Valued Contributor

Re: cache.log only contains "Failed to create...Permission denied"

Dear Vitaly Karasik and Ivan Ferriera thanks for quick reply
Vitaly as per your instruction, I did
# ps -ef|grep squid
root 2163 1 0 08:19 ? 00:00:00 /etc/init.d/squid start
nobody 2168 2163 0 08:19 ? 00:00:08 (squid) start
root 5516 5493 0 14:29 pts/0 00:00:00 grep squid

the output shows that squid is running under user nobody.

So Dear Ivan Ferriera..instead of
chown -R squid /opt/cache/squid
since squid is running under user nobody I did
chmod -R 770 /opt/cache/squid/

and problem solved ;)

# cat /usr/local/squid/var/logs/cache.log
cat /usr/local/squid/var/logs/cache.log
2007/07/31 14:40:58| storeDirWriteCleanLogs: Starting...
2007/07/31 14:40:58| Finished. Wrote 3766 entries.
2007/07/31 14:40:58| Took 0.0 seconds (1963503.6 entries/sec).
2007/07/31 14:40:58| logfileRotate: /usr/local/squid/var/logs/store.log

Once again Thanks Both of you.

Regards
Maaz
Maaz
Valued Contributor

Re: cache.log only contains "Failed to create...Permission denied"

after doing the above, executing "squid -z".. Now I found that squid returns TCP_MISS for every request.

# tail -f access.log
1185885250.096 1465 10.0.0.110 TCP_MISS/200 2082 GET http://www.google.com.sa/ - DIRECT/66.102.9.147 text/html
1185885250.948 851 10.0.0.110 TCP_MISS/200 8410 GET http://www.google.com.sa/intl/en_com/images/logo_plain.png - DIRECT/66.102.9.147 image/png
1185885251.342 981 10.0.0.110 TCP_MISS/200 1747 GET http://www.google.com.sa/favicon.ico - DIRECT/66.102.9.104 image/x-icon
1185885251.801 1678 10.0.0.110 TCP_MISS/200 6674 GET http://www.google.com.sa/images/nav_logo3.png - DIRECT/66.102.9.99 image/png
1185885274.609 961 10.0.0.110 TCP_MISS/200 1930 GET http://www.google.com.sa/ - DIRECT/66.102.9.99 text/html
1185885282.074 1409 10.0.0.110 TCP_MISS/200 1932 GET http://www.google.com.sa/ - DIRECT/66.102.9.99 text/html
1185885287.091 425 10.0.0.110 TCP_MISS/200 1929 GET http://www.google.com.sa/ - DIRECT/66.102.9.99 text/html
1185885291.034 362 10.0.0.110 TCP_MISS/200 1932 GET http://www.google.com.sa/ - DIRECT/66.102.9.99 text/html
1185885308.771 1071 10.0.0.110 TCP_MISS/200 1932 GET http://www.google.com.sa/ - DIRECT/66.102.9.99 text/html
1185885363.031 305 10.0.0.110 TCP_MISS/200 1932 GET http://www.google.com.sa/ - DIRECT/66.102.9.99 text/html

again and again ...I access google, but you can see, no one is TCP_HIT or TCP_MEM .. but all are TCP_MISS

Why ?
help plz
Regards
Maaz
Ivan Ferreira
Honored Contributor

Re: cache.log only contains "Failed to create...Permission denied"

Because HIT is when is found in the cache and miss is when you have to access directly from the server. With -z, you initialited the cache so you won't find any information there for a while.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?