/var/run/squid (run_dir) no longer created on start up
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
squid (Debian) |
Fix Released
|
Undecided
|
Unassigned | ||
squid (Ubuntu) |
Fix Released
|
High
|
Andreas Hasenack | ||
Cosmic |
Fix Released
|
High
|
Andreas Hasenack | ||
Disco |
Fix Released
|
High
|
Andreas Hasenack |
Bug Description
[Impact]
Squid in SMP mode, when "workers <N>" is set in squid.conf, uses /var/run/squid for several ipc sockets. This directory is not created by the packaging/service and as a result squid doesn't work in this situation.
[Test Case]
* install squid
sudo apt update && sudo apt install squid -y
* verify there is no /var/run/squid directory
$ sudo ls -la /var/run/squid
ls: cannot access '/var/run/squid': No such file or directory
* Due to bug #1815852, squid won't work correctly even after that directory is created, so let's consider the above enough to confirm this bug here.
With the updated packages, which also fix #1815852, the directory exists, and, due to the restart done by the upgrade, is populated already:
$ sudo ls -la /var/run/squid
total 0
drwxr-xr-x 2 proxy proxy 160 Feb 28 18:35 .
drwxr-xr-x 22 root root 820 Feb 28 18:35 ..
srwxr-x--- 1 proxy proxy 0 Feb 28 18:35 squid-coordinat
srwxr-x--- 1 proxy proxy 0 Feb 28 18:35 squid-kid-1.ipc
srwxr-x--- 1 proxy proxy 0 Feb 28 18:35 squid-kid-2.ipc
srwxr-x--- 1 proxy proxy 0 Feb 28 18:35 squid-kid-3.ipc
srwxr-x--- 1 proxy proxy 0 Feb 28 18:35 squid-kid-4.ipc
srwxr-x--- 1 proxy proxy 0 Feb 28 18:35 squid-kid-5.ipc
* and the proxy works:
$ http_proxy=http://
--2019-02-28 18:35:59-- http://
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)
Proxy request sent, awaiting response... 302 Found
Location: https:/
--2019-02-28 18:36:00-- https:/
Resolving www.ubuntu.com (www.ubuntu.com)... 91.189.89.115
Connecting to www.ubuntu.com (www.ubuntu.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘/dev/null’
/dev/null [ <=> ] 129.75K 148KB/s in 0.9s
2019-02-28 18:36:02 (148 KB/s) - ‘/dev/null’ saved [132866]
$ echo $?
0
[Regression Potential]
The fix tells systemd to create the runtime directory /run/squid (to which /var/run is a symlink) via the tmpfiles.d mechanism, a solution used by many other services already as can be seen in "ls -la /usr/lib/
The fix is already in disco, but going through migration at the moment.
[Other Info]
Not at this time.
[Original Description]
Hi,
On squid service start up in Bionic, /var/run/squid is created by /etc/init.d/squid (create_run_dir()). This doesn't happen in Cosmic nor Disco and probably is related to the migration to systemd.
Squid needs to create the squid-kid-*.ipc UNIX sockets in /var/run/squid to function on SMP set ups (workers X).
Steps to reproduce:
* spin up fresh cosmic or bionic instance/machine
* install squid
* configure 'workers 5' or enable the Rock Store cache storage type
* reboot instance
* try start up squid.
Logging shows this:
| 2019/02/15 04:46:58 kid1| commBind Cannot bind socket FD 28 to [::]: (2) No such file or directory
Related branches
- Christian Ehrhardt (community): Approve
- Canonical Server packageset reviewers: Pending requested
-
Diff: 72 lines (+44/-0)4 files modifieddebian/changelog (+9/-0)
debian/patches/series (+1/-0)
debian/patches/smp-startup-error.patch (+33/-0)
debian/squid.tmpfile (+1/-0)
- Robie Basak: Approve
- Canonical Server: Pending requested
-
Diff: 22 lines (+8/-0)2 files modifieddebian/changelog (+7/-0)
debian/squid.tmpfile (+1/-0)
Changed in squid (Ubuntu Cosmic): | |
importance: | Undecided → High |
Changed in squid (Ubuntu Disco): | |
importance: | Undecided → High |
Changed in squid (Ubuntu Disco): | |
assignee: | nobody → Andreas Hasenack (ahasenack) |
status: | Triaged → In Progress |
Changed in squid (Ubuntu Cosmic): | |
status: | Triaged → In Progress |
assignee: | nobody → Andreas Hasenack (ahasenack) |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Thank you for your bug report. THe package is in sync with Debian, would be best to report that issue to them (https:/ /bugs.debian. org/cgi- bin/pkgreport. cgi?src= squid)