[squid-users] Squid stopped working after cache.log and access.log rotation

Eliezer Croitoru eliezer at ngtech.co.il
Thu Apr 20 19:24:21 UTC 2017


Hey CM,

>From the output I understand that there wasn't a change in squid packaging for 16.04 and they still use rc\init.d startup scripts.
Also they probably use the same logrotate scripts from very long ago.
We first must understand if squid is running and it seems that systemd sees it as running.
I do not see in lsof output any port listening mentioned so I assume this is the reason for the issue in hands.
The first thing I would do is run a crontab that will check if squid is alive using a cache manager info page fetch and check if it's listening using netstat or ss.
(did you tried to see if squid is listening using netstat or ss??)
The next step would be to check your squid roatate script and to verify it's doing what it suppose to do.
After all this I would recommend changing from the rc\init.d startup script to a real system based one and abandon the old rotation scripts of Ubuntu or fix them.

If you are looking for a fix it's one path and if you are looking to get the work done properly by Ubuntu it's a whole new wagon.
I have been working on squid packages for Ubuntu and Debian that uses system scripts but the packages are not perfected yet.

Let me know the path you want to choose and also your approach to things and I will try to help you with which of the options you will choose to resolve the issues.

Eliezer

----
http://ngtech.co.il/lmgtfy/
Linux System Administrator
Mobile: +972-5-28704261
Email: eliezer at ngtech.co.il


From: Chee M Gui [mailto:cheemeng at function.com] 
Sent: Thursday, April 20, 2017 7:17 PM
To: Eliezer Croitoru <eliezer at ngtech.co.il>
Cc: squid-users at lists.squid-cache.org
Subject: Re: [squid-users] Squid stopped working after cache.log and access.log rotation

Hi Eliezer

Thank you for the response, and sorry for the late reply.

As requested, here are the output of the commands you suggested:
root at paproxy:/# systemctl status squid
● squid.service - LSB: Squid HTTP Proxy version 3.x
   Loaded: loaded (/etc/init.d/squid; bad; vendor preset: enabled)
   Active: active (running) since Wed 2017-03-15 14:47:53 PDT; 1 months 5 days ago
     Docs: man:systemd-sysv-generator(8)
    Tasks: 4
   Memory: 54.4M
      CPU: 2min 38.957s
   CGroup: /system.slice/squid.service
           ├─25482 /usr/sbin/squid -YC -f /etc/squid/squid.conf
           ├─25484 (squid-1) -YC -f /etc/squid/squid.conf
           ├─25485 (logfile-daemon) /var/log/squid/access.log
           └─25486 (unlinkd)

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
root at paproxy:/#



top - 09:11:45 up 54 days, 23:51,  2 users,  load average: 0.00, 0.00, 0.00
Tasks: 141 total,   1 running, 140 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.0 us,  0.0 sy,  0.0 ni, 99.9 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  6043140 total,  4844728 free,   135292 used,  1063120 buff/cache
KiB Swap:  6222844 total,  6222844 free,        0 used.  5556300 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
23355 root      20   0   41668   3776   3236 R   6.7  0.1   0:00.01 top
    1 root      20   0   37884   5968   4020 S   0.0  0.1   0:27.20 systemd
    2 root      20   0       0      0      0 S   0.0  0.0   0:00.22 kthreadd
    3 root      20   0       0      0      0 S   0.0  0.0   0:01.01 ksoftirqd/0
    5 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/0:0H
    7 root      20   0       0      0      0 S   0.0  0.0   1:28.65 rcu_sched
    8 root      20   0       0      0      0 S   0.0  0.0   0:00.00 rcu_bh
    9 root      rt   0       0      0      0 S   0.0  0.0   0:00.14 migration/0
   10 root      rt   0       0      0      0 S   0.0  0.0   0:05.53 watchdog/0
   11 root      rt   0       0      0      0 S   0.0  0.0   0:05.75 watchdog/1
   12 root      rt   0       0      0      0 S   0.0  0.0   0:00.14 migration/1
   13 root      20   0       0      0      0 S   0.0  0.0   0:02.48 ksoftirqd/1
   15 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 kworker/1:0H
   16 root      20   0       0      0      0 S   0.0  0.0   0:00.00 kdevtmpfs
   17 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 netns
   18 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 perf
   19 root      20   0       0      0      0 S   0.0  0.0   0:01.26 khungtaskd
   20 root       0 -20       0      0      0 S   0.0  0.0   0:00.00 writeback


root at paproxy:/# ps -aux | grep squid
root     23358  0.0  0.0  14224   976 pts/0    S+   09:12   0:00 grep --color=auto squid
root     25482  0.0  0.1 109272  6416 ?        Ss   Mar15   0:00 /usr/sbin/squid -YC -f /etc/squid/squid.conf
proxy    25484  0.0  0.7 166684 45184 ?        S    Mar15   2:27 (squid-1) -YC -f /etc/squid/squid.conf
proxy    25485  0.0  0.0  13280  1648 ?        S    Mar15   0:03 (logfile-daemon) /var/log/squid/access.log
root at paproxy:/#


root at paproxy:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            2.9G     0  2.9G   0% /dev
tmpfs           591M   60M  531M  11% /run
/dev/sda1       911G  1.9G  863G   1% /
tmpfs           2.9G   12K  2.9G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           2.9G     0  2.9G   0% /sys/fs/cgroup
tmpfs           591M     0  591M   0% /run/user/1000
tmpfs           591M     0  591M   0% /run/user/0
root at paproxy:/#



root at paproxy:/# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            2.9G     0  2.9G   0% /dev
tmpfs           591M   60M  531M  11% /run
/dev/sda1       911G  1.9G  863G   1% /
tmpfs           2.9G   12K  2.9G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           2.9G     0  2.9G   0% /sys/fs/cgroup
tmpfs           591M     0  591M   0% /run/user/1000
tmpfs           591M     0  591M   0% /run/user/0
root at paproxy:/#


root at paproxy:/# lsof -n|egrep "proxy|squid" | more
squid     25482                  root  cwd       DIR                8,1     4096          2 /
squid     25482                  root  rtd       DIR                8,1     4096          2 /
squid     25482                  root  txt       REG                8,1  6430816   41946763 /usr/sbin/squid
squid     25482                  root  mem       REG                8,1    47648   10093387 /lib/x86_64-linux-gnu/libnss_nis-2.23.
so
squid     25482                  root  mem       REG                8,1    93128   10093399 /lib/x86_64-linux-gnu/http://libnsl-2.23.so
squid     25482                  root  mem       REG                8,1    35688   10093400 /lib/x86_64-linux-gnu/libnss_compat-2.
23.so
squid     25482                  root  mem       REG                8,1    47600   10093403 /lib/x86_64-linux-gnu/libnss_files-2.2
3.so
squid     25482                  root  mem       REG                8,1 25913104   41944015 /usr/lib/x86_64-linux-gnu/libicudata.s
o.55.1
squid     25482                  root  mem       REG                8,1    22520   10093098 /lib/x86_64-linux-gnu/libmnl.so.0.1.0
squid     25482                  root  mem       REG                8,1    26248   41948589 /usr/lib/x86_64-linux-gnu/libnfnetlink
.so.0.2.0


Thank you once again

CM



On Thu, Mar 23, 2017 at 1:59 PM, Eliezer Croitoru <mailto:eliezer at ngtech.co.il> wrote:
There is another option!
The log rotate script is doing something nasty or the systemd service file start up squid in a weird way.
The output of:
$ systemctl status squid
$ top -n1 -b
$ ps aux
$ df -h
$ netstat -ntulp
$ lsof -n|egrep "proxy|squid"

How many clients this system has?
Is the system facing the Internet directly or behind some nat(aws or another provider)?

The above are the basic required data to understand the situation.

All The Bests,
Eliezer

----
http://ngtech.co.il/lmgtfy/
Linux System Administrator
Mobile: tel:%2B972-5-28704261
Email: mailto:eliezer at ngtech.co.il


From: squid-users [mailto:mailto:squid-users-bounces at lists.squid-cache.org] On Behalf Of Chee M Gui
Sent: Wednesday, March 22, 2017 5:18 PM
To: mailto:squid-users at lists.squid-cache.org
Subject: [squid-users] Squid stopped working after cache.log and access.log rotation


Hi All

We recently installed Squid 3.5.12-1ubuntu7.3 on Ubuntu 16.04.2 LTS.  It ran fine at first but stopped working after a while.   telnet server 3128 still works, i.e., opens a blank window, but Squid is just not accepting requests.    Then we realized that there is no new access.log file.   The access.log file stopped rotated at 6:24AM on 3/17/2017.    It looks like Squid wasn't able to create a new access.log?  We could not find any error message in syslog or the cache.log.      We haven't rebooted the server because we want to know what went wrong.   It isn't the firewall blocking Squid because Squid was working fine all the while until recently.  Also after it stopped working, we disabled the firewall to see if it would work but it still didn't work.

root at paproxy:/var/log/squid# ls -alt
total 15536
drwxr-xr-x 2 proxy proxy      4096 Mar 21 06:25 .
-rw-r----- 1 proxy proxy        63 Mar 21 06:25 cache.log
drwxrwxr-x 9 root  syslog     4096 Mar 21 06:25 ..
-rw-r----- 1 proxy proxy        63 Mar 20 06:25 cache.log.1
-rw-r----- 1 proxy proxy        83 Mar 19 06:25 cache.log.2.gz
-rw-r----- 1 proxy proxy  15759111 Mar 17 06:24 access.log.1
-rw-r----- 1 proxy proxy    117223 Mar 17 05:52 netdb.state

Any ideas what went wrong?

Thank you very much in anticipation.

Gui
_______________________________________________
squid-users mailing list
mailto:squid-users at lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users




-- 
Chee Meng Gui
Function Engineering
650-833-0660



More information about the squid-users mailing list