squid3 always run with -N option, incompatible with SMP option (workers)

Bug #1235681 reported by Michael Opdenacker
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
squid3 (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Hi,

I switch to Ubuntu 13.10 to enjoy a version of Squid more recent than 3.1. (it's 3.3 in 13.10)

My currrent version is 3.3.8-1ubuntu3

One of the reasons for switching was support for SMP (Squid3 running multiple instances of itself in a native way).

However, even if you put "workers 8" (for example) in /etc/squid3/squid.conf, this option is not enable because Squid3 is always started with the "-N" option ("no daemon" mode), which is incompatible with the "workers" option.

See http://www.squid-cache.org/Doc/config/workers/ for details.

One option is to remove the "-N" option in /etc/init/squid3. This option could be put in /etc/default/squid3 for people who really want it.

However, this is just a quick and dirty work-around, as after this change, stopping the service with "service squid3 stop" no longer works. You have to manually kill the "squid-coord-X" process. Therefore, extra rework is needed in /etc/init/squid3.

That's all I have for the moment. Better workarounds and solutions are welcome! I'll post more if I have any.

Cheers,

Michael.

Tags: trusty
Revision history for this message
Robie Basak (racb) wrote :

Thank you for reporting this bug and helping to make Ubuntu better.

This sounds reasonable to me. The current upstart script and use of -N precludes the use of the "workers" configuration option. Ideally, we'd fix the upstart script to let squid daemonise itself so that it can do this.

Changed in squid3 (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
juniper (franz-angeli) wrote :

this bug is still active in Ubuntu 14.04 LTS

Revision history for this message
Johan Ramm-Ericson (johanre) wrote :

I have also encountered the two issues Michael mentions and two others in the upstart script /etc/init/squid3 that are - from my perspective - essential to get SMP Squid3 working. They are:

* an "expect daemon" line needs to be included
* a statement that checks for the presence of /var/run/squid3 and creates the directory if necessary, as well as granting the squid3 process owner write permissions in the directory.

However; seeing as this issue has not seen any activity or resolution, is my impression correct that (a) SMP Squid has very few active users, and (b) despite this being a buggy feature in an LTS release, this is not a priority to be fixed?

Revision history for this message
Robie Basak (racb) wrote :

I haven't treated this as a priority to be fixed because I presume that SMP squid has very few active users. Only three people have marked themselves as affected by this bug in over a year.

If someone can prepare a fix and test that it works for all use cases, including for non-SMP squid users on 14.04, then we can fix it. See https://wiki.ubuntu.com/StableReleaseUpdates#Procedure

However, I am concerned that changing the way that squid starts for every existing 14.04 user may result in regressions that would be unacceptable in a stable release. I'm not ruling an update out, but I do expect a proposed fix to include very careful consideration of *all* use cases that might be affected. This is difficult, so that's why we're back to the number of users affected by this bug. A workaround for affected users published here might be more suitable.

For Vivid and Wily, we're using systemd and not the upstart script any more, so this bug may no longer affect them and so may not be an issue by the next LTS release.

tags: added: trusty
Revision history for this message
Johan Ramm-Ericson (johanre) wrote :

Thanks for the reminder! I think I'll give it a try since this is something that would improve Squid performance for us.

Revision history for this message
Amos Jeffries (yadi) wrote :

For the record this usage of -N is an intentional addition for Upstart integration with Squid-3. It is needed to avoid those much worse process control start/stop issues mentioned in the report, and other less obvious problems around the system.

The Ubuntu package dropping its Upstart integration patch as a whole will remove this issue. At cost of dropping back to SysVinit for process management.

Squid-3.5 versions currently in Debian upstream contains different integration for dual compatibility with SysVinit and systemd which offers better behaviour (and those "service" commands), but this does not affect the Upstart support.

Squid-4 versions (not yet packaged) will be coming with some changes that should make the -N option no longer needed for Upstart. That will need to be verified when the time comes, if Upstart intgration is still in the Ubuntu package at that point.

Revision history for this message
Amos Jeffries (yadi) wrote :

This is fixed in the squid package now available in Xenial, which removes upstart integration.

Changed in squid3 (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.