You are not logged in.

#1 2019-05-19 19:02:24

amaro
Member
From: 5.11.1-1-ck-ivybridge, xfce
Registered: 2014-05-09
Posts: 363

squid FATAL:failed to open squid.pid + Cannot write log file

Hello everybody!

I have just installed squid and get this

[root@G0 vb]# systemctl start squid
[root@G0 vb]# systemctl status squid
● squid.service - Squid Web Proxy Server
   Loaded: loaded (/usr/lib/systemd/system/squid.service; disabled; v>
   Active: active (running) since Sun 2019-05-19 21:37:49 EEST; 1s ago
     Docs: man:squid(8)
  Process: 9863 ExecStartPre=/usr/sbin/squid --foreground -z (code=ex>
  Process: 9866 ExecStart=/usr/sbin/squid -sYC (code=exited, status=0>
 Main PID: 9867 (squid)
    Tasks: 3 (limit: 4535)
   Memory: 35.7M
   CGroup: /system.slice/squid.service
           ├─9867 /usr/sbin/squid -sYC
           ├─9874 (squid-1) --kid squid-1 -sYC
           └─9876 (unlinkd)

May 19 21:37:51 G0 squid[9874]:         0 Objects loaded.
May 19 21:37:51 G0 squid[9874]:         0 Objects expired.
May 19 21:37:51 G0 squid[9874]:         0 Objects cancelled.
May 19 21:37:51 G0 squid[9874]:         0 Duplicate URLs purged.
May 19 21:37:51 G0 squid[9874]:         0 Swapfile clashes avoided.
May 19 21:37:51 G0 squid[9874]:   Took 0.02 seconds (  0.00 objects/s>
May 19 21:37:51 G0 squid[9874]: Beginning Validation Procedure
May 19 21:37:51 G0 squid[9874]:   Completed Validation Procedure
May 19 21:37:51 G0 squid[9874]:   Validated 0 Entries
May 19 21:37:51 G0 squid[9874]:   store_swap_size = 0.00 KB

squid -k check

[root@G0 vb]# squid -k check
WARNING: Cannot write log file: /var/log/squid/cache.log
/var/log/squid/cache.log: Permission denied
         messages will be sent to 'stderr'.
2019/05/19 21:38:03| Set Current Directory to /var/cache/squid
2019/05/19 21:38:03| FATAL: failed to open /run/squid.pid: (2) No such file or directory
    exception location: File.cc(190) open

squid -k parse

[root@G0 vb]# squid -k parse
2019/05/19 21:37:58| Startup: Initializing Authentication Schemes ...
2019/05/19 21:37:58| Startup: Initialized Authentication Scheme 'basic'
2019/05/19 21:37:58| Startup: Initialized Authentication Scheme 'digest'
2019/05/19 21:37:58| Startup: Initialized Authentication Scheme 'negotiate'
2019/05/19 21:37:58| Startup: Initialized Authentication Scheme 'ntlm'
2019/05/19 21:37:58| Startup: Initialized Authentication.
2019/05/19 21:37:58| Processing Configuration File: /etc/squid/squid.conf (depth 0)
2019/05/19 21:37:58| Processing: acl localnet src 10.0.0.0/8	# RFC1918 possible internal network
2019/05/19 21:37:58| Processing: acl localnet src 172.16.0.0/12	# RFC1918 possible internal network
2019/05/19 21:37:58| Processing: acl localnet src 192.168.0.0/16	# RFC1918 possible internal network
2019/05/19 21:37:58| Processing: acl localnet src fc00::/7       # RFC 4193 local private network range
2019/05/19 21:37:58| Processing: acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines
2019/05/19 21:37:58| Processing: acl SSL_ports port 443
2019/05/19 21:37:58| Processing: acl Safe_ports port 80		# http
2019/05/19 21:37:58| Processing: acl Safe_ports port 21		# ftp
2019/05/19 21:37:58| Processing: acl Safe_ports port 443		# https
2019/05/19 21:37:58| Processing: acl Safe_ports port 70		# gopher
2019/05/19 21:37:58| Processing: acl Safe_ports port 210		# wais
2019/05/19 21:37:58| Processing: acl Safe_ports port 1025-65535	# unregistered ports
2019/05/19 21:37:58| Processing: acl Safe_ports port 280		# http-mgmt
2019/05/19 21:37:58| Processing: acl Safe_ports port 488		# gss-http
2019/05/19 21:37:58| Processing: acl Safe_ports port 591		# filemaker
2019/05/19 21:37:58| Processing: acl Safe_ports port 777		# multiling http
2019/05/19 21:37:58| Processing: acl CONNECT method CONNECT
2019/05/19 21:37:58| Processing: http_access deny !Safe_ports
2019/05/19 21:37:58| Processing: http_access deny CONNECT !SSL_ports
2019/05/19 21:37:58| Processing: http_access allow localhost manager
2019/05/19 21:37:58| Processing: http_access deny manager
2019/05/19 21:37:58| Processing: http_access deny to_localhost
2019/05/19 21:37:58| Processing: http_access allow localnet
2019/05/19 21:37:58| Processing: http_access allow localhost
2019/05/19 21:37:58| Processing: http_access deny all
2019/05/19 21:37:58| Processing: http_port 3128
2019/05/19 21:37:58| Processing: http_port 3129 intercept
2019/05/19 21:37:58| Starting Authentication on port [::]:3129
2019/05/19 21:37:58| Disabling Authentication on port [::]:3129 (interception enabled)
2019/05/19 21:37:58| Processing: cache_dir ufs /var/cache/squid 100 16 256
2019/05/19 21:37:58| Processing: coredump_dir /var/cache/squid
2019/05/19 21:37:58| Processing: cache_mem 64 MB
2019/05/19 21:37:58| Processing: maximum_object_size 10 MB
2019/05/19 21:37:58| Processing: visible_hostname localhost
2019/05/19 21:37:58| Processing: shutdown_lifetime 3 seconds
2019/05/19 21:37:58| Processing: dns_nameservers 127.0.0.1
2019/05/19 21:37:58| Processing: refresh_pattern ^ftp:		1440	20%	10080
2019/05/19 21:37:58| Processing: refresh_pattern ^gopher:	1440	0%	1440
2019/05/19 21:37:58| Processing: refresh_pattern -i (/cgi-bin/|\?) 0	0%	0
2019/05/19 21:37:58| Processing: refresh_pattern .		0	20%	4320
2019/05/19 21:37:58| Processing: via off
2019/05/19 21:37:58| Processing: forwarded_for off
2019/05/19 21:37:58| Processing: follow_x_forwarded_for deny all
2019/05/19 21:37:58| Processing: request_header_access From deny all
2019/05/19 21:37:58| Processing: request_header_access Server deny all
2019/05/19 21:37:58| Processing: request_header_access WWW-Authenticate deny all
2019/05/19 21:37:58| Processing: request_header_access Link deny all
2019/05/19 21:37:58| Processing: request_header_access Cache-Control deny all
2019/05/19 21:37:58| Processing: request_header_access Proxy-Connection deny all
2019/05/19 21:37:58| Processing: request_header_access X-Cache deny all
2019/05/19 21:37:58| Processing: request_header_access X-Cache-Lookup deny all
2019/05/19 21:37:58| Processing: request_header_access Via deny all
2019/05/19 21:37:58| Processing: request_header_access X-Forwarded-For deny all
2019/05/19 21:37:58| Processing: request_header_access Pragma deny all
2019/05/19 21:37:58| Processing: request_header_access Keep-Alive deny all
2019/05/19 21:37:58| WARNING: HTTP requires the use of Via
2019/05/19 21:37:58| Initializing https:// proxy context
WARNING: Cannot write log file: /var/log/squid/cache.log
/var/log/squid/cache.log: Permission denied
         messages will be sent to 'stderr'.

squid.conf

#
# Recommended minimum configuration:
#

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
acl localnet src 10.0.0.0/8     # RFC1918 possible internal network
acl localnet src 172.16.0.0/12  # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7       # RFC 4193 local private network range
acl localnet src fe80::/10      # RFC 4291 link-local (directly plugg>

acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl CONNECT method CONNECT

#
# Recommended minimum Access Permission configuration:
#
# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager

# We strongly recommend the following be uncommented to protect innoc>
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networ>
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost

# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
http_port 3128  
http_port 3129 intercept

# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /var/cache/squid 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/cache/squid

cache_mem 64 MB

maximum_object_size 10 MB

visible_hostname localhost

shutdown_lifetime 3 seconds

dns_nameservers 127.0.0.1                                          

#
# Add any of your own refresh_pattern entries above these.
#
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320

#Privacy Things
via off
forwarded_for off
follow_x_forwarded_for deny all

request_header_access From deny all
request_header_access Server deny all
request_header_access WWW-Authenticate deny all
request_header_access Link deny all
request_header_access Cache-Control deny all
request_header_access Proxy-Connection deny all
request_header_access X-Cache deny all
request_header_access X-Cache-Lookup deny all
request_header_access Via deny all
request_header_access X-Forwarded-For deny all
request_header_access Pragma deny all
request_header_access Keep-Alive deny all

Any help is highly appreciated!
Thank you!

EDIT: After reboot I got this

ctl status squid
● squid.service - Squid Web Proxy Server
   Loaded: loaded (/usr/lib/systemd/system/squid.service; disabled; vendor preset: disabled)
   Active: failed (Result: timeout) since Mon 2019-05-20 02:26:19 EEST; 1min 28s ago
     Docs: man:squid(8)
  Process: 1282 ExecStartPre=/usr/sbin/squid --foreground -z (code=exited, status=0/SUCCESS)
  Process: 1285 ExecStart=/usr/sbin/squid -sYC (code=exited, status=0/SUCCESS)

May 20 02:24:54 G0 squid[1305]:   Finished.  Wrote 0 entries.
May 20 02:24:54 G0 squid[1305]:   Took 0.00 seconds (  0.00 entries/sec).
May 20 02:24:54 G0 squid[1305]: FATAL: I don't handle this error well!
May 20 02:24:54 G0 squid[1305]: Squid Cache (Version 4.7): Terminated abnormally.
May 20 02:24:54 G0 squid[1286]: Squid Parent: squid-1 process 1305 exited with status 1
May 20 02:24:54 G0 squid[1286]: Squid Parent: squid-1 process 1305 will not be restarted for 3600 seconds due to repeated, frequent failures
May 20 02:24:54 G0 squid[1286]: Exiting due to repeated, frequent failures
May 20 02:26:19 G0 systemd[1]: squid.service: Start operation timed out. Terminating.
May 20 02:26:19 G0 systemd[1]: squid.service: Failed with result 'timeout'.
May 20 02:26:19 G0 systemd[1]: Failed to start Squid Web Proxy Server.

Last edited by amaro (2019-05-19 23:36:43)

Offline

Board footer

Powered by FluxBB