Start a conversation

Warning: 'Cannot Write Log File: /var/log/squid/cache.log'

Overview

The article provides a resolution for the following error message:

pm[2083]: [pm.NOTICE]: Output from squid (Squid Cache Proxy) (pid 12283): WARNING: Cannot write log file: /var/log/squid/cache.log
pm[2083]: [pm.NOTICE]: Output from squid (Squid Cache Proxy) (pid 12283): /var/log/squid/cache.log: Permission denied
pm[2083]: [pm.NOTICE]: Output from squid (Squid Cache Proxy) (pid 12283): messages will be sent to 'stderr'.
pm[2083]: [pm.NOTICE]: Output from squid (Squid Cache Proxy) (pid 12283): 2016/04/28 06:14:12| Set Current Directory to /var/opt/tms/snapshots/.running/squid
pm[2083]: [pm.NOTICE]: Output from squid (Squid Cache Proxy) (pid 12283): WARNING: Cannot write log file: /var/log/squid/cache.log
pm[2083]: [pm.NOTICE]: Output from squid (Squid Cache Proxy) (pid 12283): /var/log/squid/cache.log: Permission denied
pm[2083]: [pm.NOTICE]: Output from squid (Squid Cache Proxy) (pid 12283): messages will be sent to 'stderr'.

 

Root Cause

The above error message means that the squid process is not able to write the files under the /var/log/squid/ because of the change of permissions or owner names.

 

Resolution  

The default permission and owner of this file can be gathered by running the following commands:

  1. [admin@exinda-3ac8d8 log]# cd /var/log

    Output:
    drwxr-xr-x 2 squid squid 4096 May 2 11:55 squid

  2. [admin@exinda-3ac8d8 log]# cd squid/
  3. [admin@exinda-3ac8d8 squid]# ls -al

    Output:
    total 21224
    drwxr-xr-x 2 squid squid 4096 May 2 11:55 .
    drwxr-xr-x 28 admin root 4096 May 9 01:16 ..
    -rw-r----- 1 squid squid 13792709 May 9 12:49 access.log
    -rw-r----- 1 squid squid 7892243 May 9 08:33 cache.log
    -rw-r----- 1 squid squid 1560 May 9 02:15 rewrite.log

If the owner and the permissions are any different from what is stated above, then use the below command to change it:

chown -R <owner name >:<group name> <file name>
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments