squid starts and stops immediately (after upgrade from karmic to lucid)

Bug #561750 reported by Ernst Kloppenburg on 2010-04-12
52
This bug affects 8 people
Affects Status Importance Assigned to Milestone
squid (Ubuntu)
Medium
Clint Byrum
Lucid
Medium
Clint Byrum
Maverick
Medium
Clint Byrum
squid3 (Ubuntu)
Undecided
Unassigned
Lucid
Undecided
Unassigned
Maverick
Undecided
Unassigned

Bug Description

Binary package hint: squid

after booting, squid starts normally, and then stops again immediately. There is no error (see logfile).

After that i can start squid with 'sudo start squid' and it works flawlessly (this bug report is made through it).

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: squid 2.7.STABLE7-1ubuntu11
ProcVersionSignature: Ubuntu 2.6.32-19.28-generic 2.6.32.10+drm33.1
Uname: Linux 2.6.32-19-generic i686
NonfreeKernelModules: fglrx
Architecture: i386
Date: Mon Apr 12 21:12:34 2010
ProcEnviron:
 LANGUAGE=
 PATH=(custom, user)
 LANG=de_DE.UTF-8
 SHELL=/bin/bash
SourcePackage: squid

Mathias Gug (mathiaz) wrote :

Could you outline your network configuration?

Do you see any messages related to init and squid in /var/log/syslog?

Changed in squid (Ubuntu):
importance: Undecided → Medium
status: New → Incomplete

I have an ethernet interface with a static IP address, there is no traffic routed to the internet over this interface.

Secondly there is a dsl-connection (pppoe) that provides the route to the internet.

See also attached file /etc/network/interfaces

But I also have changed /etc/default/squid to prevent squid from doing the DNS tests during start (there are no error messages in /var/log/squid attached earlier).

$ grep squid /var/log/syslog
Apr 14 07:38:33 rechner6 init: squid main process (1086) killed by HUP signal

$ grep init: /var/log/syslog
Apr 14 07:38:33 rechner6 init: squid main process (1086) killed by HUP signal
Apr 14 07:38:33 rechner6 init: ssh main process (1095) terminated with status 255
Apr 14 07:38:35 rechner6 init: anacron main process (1296) killed by TERM signal
Apr 14 07:38:35 rechner6 init: plymouth-stop pre-start process (2288) terminated with status 1

On Wed, Apr 14, 2010 at 05:55:34AM -0000, Ernst Kloppenburg wrote:
> $ grep squid /var/log/syslog
> Apr 14 07:38:33 rechner6 init: squid main process (1086) killed by HUP signal
>
>
> $ grep init: /var/log/syslog
> Apr 14 07:38:33 rechner6 init: squid main process (1086) killed by HUP signal
> Apr 14 07:38:33 rechner6 init: ssh main process (1095) terminated with status 255

This is probably due to the fact that the dsl interface is brought up - which
triggers a reload of some daemons. Unfortunately it seems that squid is not
restarted. Does the squid upstart job has a respawn option?

--
Mathias Gug
Ubuntu Developer http://www.ubuntu.com

- there is no respawn option in /etc/init/squid.conf (but I think this wouldn't normally be a problem, except when squid crashed by itself)

- there is exactly one thing that does something to squid when the dsl-interface is brought up (I have resolvconf installed which is suggested by the squid package)

  /etc/resolvconf/update-libc.d/squid

which contains the command
  'invoke-rc.d squid reload'

This command does the wrong thing, it stops squid:

root@rechner6:~# start squid
squid start/running, process 3328

(now squid is usable)

root@rechner6:~# /etc/resolvconf/update-libc.d/squid
Rather than invoking init scripts through /etc/init.d, use the service(8)
[...]

root@rechner6:~# status squid
squid stop/waiting

(the squid/cache.log shows the normal shutdown sequence)

Chuck Short (zulcss) wrote :

This should be fixed now for lucid, thanks for the bug report.

Regards
chuck

Changed in squid (Ubuntu):
status: Incomplete → Fix Committed
assignee: nobody → Chuck Short (zulcss)
D J Gardner (djgardner) wrote :

Chuck, you said it "should be fixed for Lucid" back in April. Unfortunately, I'm still observing
exactly the same problem, of squid starting then immediatly stopping on boot.
I have resolvconf, along with a local copy of bind9 for my home network.

My /etc/resolvconf/update-libc.d/squid has the lines:

if status squid | grep "start/running" > /dev/null; then
        restart squid
fi

Syslog reveals:

Aug 16 11:30:34 foo squid[1868]: Squid Parent: child process 1870 started
[...]
Aug 16 11:30:38 foo acpid: 1 client rule loaded
Aug 16 11:30:39 foo kernel: [ 78.143745] nf_conntrack version 0.5.0 (10981 buckets, 43924 max)
[...]
Aug 16 11:30:40 foo named[2367]: starting BIND 9.7.0-P1 -u bind
Aug 16 11:30:40 foo named[2367]: running
[...]
Aug 16 11:30:41 foo init: squid main process (1868) killed by TERM signal
Aug 16 11:30:41 foo init: squid main process (2455) terminated with status 1

The relevant portion of cache.log ends up like:

2010/08/16 11:30:39| 0 Objects expired.
2010/08/16 11:30:39| 0 Objects cancelled.
2010/08/16 11:30:39| 0 Duplicate URLs purged.
2010/08/16 11:30:39| 0 Swapfile clashes avoided.
2010/08/16 11:30:39| Took 4.5 seconds (18266.9 objects/sec).
2010/08/16 11:30:39| Beginning Validation Procedure
2010/08/16 11:30:39| Completed Validation Procedure
2010/08/16 11:30:39| Validated 82655 Entries
2010/08/16 11:30:39| store_swap_size = 2793828k
2010/08/16 11:30:39| storeLateRelease: released 0 objects
2010/08/16 11:30:41| Preparing for shutdown after 0 requests
2010/08/16 11:30:41| Waiting 3 seconds for active connections to finish
2010/08/16 11:30:41| FD 16 Closing HTTP connection
2010/08/16 11:30:41| Shutting down...

Oktay Altunergil (oktaya) wrote :

I am having the same symptoms on lucid with 2.7.STABLE7-1ubuntu12 . When I boot the server, squid will not start. I have to manually start it. All boot methods ; service squid start, squid start, /etc/init.d/squid start are behaving erractically. Sometimes they work fine, sometimes they say "Failed to start", and sometimes "No instance" (When restarting).

D J Gardner (djgardner) wrote :

I've done the following and this seems to have solved the issue for me:

1) added a line in /etc/default/squid
SQUID_ARGS='-D'
   (disable startup DNS checks, since my server is not always fully started by the time squid starts)
I'm fairly sure that squid used to be started with -D by default and I'd see it as a regression
that it isn't now.

2) replaced "restart squid" with "reload squid" in /etc/resolvconf/update-libc.d/squid.

Thierry Carrez (ttx) on 2010-08-26
Changed in squid (Ubuntu):
status: Fix Committed → In Progress
Thierry Carrez (ttx) on 2010-09-02
tags: added: server-mrs
Mathias Gug (mathiaz) on 2010-09-15
Changed in squid (Ubuntu Maverick):
status: In Progress → Fix Released
Dominik (domfi) wrote :

It seems, that this is not fixed in 10.04. We need this fixed in LTS.

# dpkg -l |grep squid
ii squid 2.7.STABLE7-1ubuntu12.2 Internet object cache (WWW proxy cache)
ii squid-common 2.7.STABLE7-1ubuntu12.2 Internet object cache (WWW proxy cache) - comm
ii squid-langpack 20100111-1 Localized error pages for Squid

# cat /etc/resolvconf/update-libc.d/squid
#!/bin/sh

PATH="/usr/sbin:/usr/bin:/sbin:/bin"

# Make squid aware of changes to resolv.conf
if status squid | grep "start/running" > /dev/null; then
 restart squid
fi

Clint Byrum (clint-fewbar) wrote :

D J, I would agree with you that -D should be in the default args for squid. I'm not sure why it was removed, but this counts as a regression as in karmic -D would allow squid to start without a valid network connection.

Marking as regression-release, and changing back to Triaged, as I don't feel that the bug is actually fixed completely by changing restart to reload. We also need to add -D back into the default squid arguments.

tags: added: regression-release
Changed in squid (Ubuntu):
status: Fix Released → Triaged
Changed in squid (Ubuntu Maverick):
status: Fix Released → Triaged
Changed in squid (Ubuntu Lucid):
status: New → Triaged
importance: Undecided → Medium
milestone: none → ubuntu-10.04.3
Changed in squid (Ubuntu):
assignee: Chuck Short (zulcss) → Clint Byrum (clint-fewbar)
status: Triaged → In Progress
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package squid - 2.7.STABLE9-2.1ubuntu6

---------------
squid (2.7.STABLE9-2.1ubuntu6) natty; urgency=low

  * debian/squid.upstart: start on changed to start on transition to
    runlevel 2 (LP: #561779)
  * debian/squid.upstart: SQUID_ARGS default value set to -D so DNS
    checks are not performed at startup (LP: #561750)
 -- Clint Byrum <email address hidden> Fri, 01 Apr 2011 13:59:06 -0700

Changed in squid (Ubuntu):
status: In Progress → Fix Released
Dominik (domfi) wrote :

Haven't checked if this is included too but the second Fix is also (more) important for us (#11):

2) replaced "restart squid" with "reload squid" in /etc/resolvconf/update-libc.d/squid.

Hopefully this is included too. If not squid will continue stopping right after starting it. This is what I've noticed after I've set "-D" in /etc/default/squid.

Clint Byrum (clint-fewbar) wrote :

Excerpts from Dominik's message of Mon Apr 04 17:30:54 UTC 2011:
> Haven't checked if this is included too but the second Fix is also
> (more) important for us (#11):
>
> 2) replaced "restart squid" with "reload squid" in /etc/resolvconf
> /update-libc.d/squid.
>
> Hopefully this is included too. If not squid will continue stopping
> right after starting it. This is what I've noticed after I've set "-D"
> in /etc/default/squid.

Yes, the change to use reload was done in an earlier upload and remains
in the package. This fix just added -D back into the default args so
squid doesn't immediately stop again if there's no DNS server available
yet.

Changed in squid (Ubuntu Lucid):
assignee: nobody → Clint Byrum (clint-fewbar)
status: Triaged → In Progress
Clint Byrum (clint-fewbar) wrote :

Uploaded fixes to maverick-proposed and lucid-proposed.

Changed in squid (Ubuntu Maverick):
assignee: Chuck Short (zulcss) → Clint Byrum (clint-fewbar)
status: Triaged → Fix Committed
Changed in squid (Ubuntu Lucid):
status: In Progress → Fix Committed

Accepted squid into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Martin Pitt (pitti) wrote :

Accepted squid into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

I tested the package from maverick-proposed against the current package from maverick: both of the problems that were discussed in this bug report are now gone (squid starts sucessfully with network not being available yet, resolvconf script reloads the squid configuration and does not kill squid)

Thanks Clint for finally fixing this bug.

tags: added: verification-done-maverick
Clint Byrum (clint-fewbar) wrote :

Ernst, thanks for verifying on maverick. We still need somebody to verify on lucid!

now I have tested squid 2.7.STABLE7-1ubuntu12.3 on lucid (on a copy of the system where this bug report originated)

-> squid starts with network not yet available
-> invocation of /etc/resolvconf/update-libc.d/squid does no longer kill it
-> everything else is normal
Thus verified.

There is one thing I do not understand yet: I thought 'restart' was changed to 'reload' in /etc/resolvconf/update-libc.d/squid (see comment #16 above). But it isn't. Still it works, the bug is fixed.

Martin Pitt (pitti) on 2011-06-28
tags: added: verification-done
removed: verification-done-maverick verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package squid - 2.7.STABLE7-1ubuntu12.3

---------------
squid (2.7.STABLE7-1ubuntu12.3) lucid-proposed; urgency=low

  * debian/squid.upstart: SQUID_ARGS default value set to -D so DNS
    checks are not performed at startup (LP: #561750)
 -- Clint Byrum <email address hidden> Wed, 18 May 2011 10:00:18 -0700

Changed in squid (Ubuntu Lucid):
status: Fix Committed → Fix Released
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package squid - 2.7.STABLE9-2ubuntu5.1

---------------
squid (2.7.STABLE9-2ubuntu5.1) maverick-proposed; urgency=low

  * debian/squid.upstart: SQUID_ARGS default value set to -D so DNS
    checks are not performed at startup (LP: #561750)
 -- Clint Byrum <email address hidden> Wed, 18 May 2011 10:07:20 -0700

Changed in squid (Ubuntu Maverick):
status: Fix Committed → Fix Released

the new maverick package 2.7.STABLE9-2ubuntu5.1 still has the problem that squid is killed when the
resolvconf script is called, exactly as described in comment #7 above.

The maverick packages still has 'reload squid' in /etc/resolvconf/update-
libc.d/squid. This kills squid, so that it is not running after the interface
comes up.
It should contain 'restart squid' which works fine.

-> it seems to me that restart and reload was mixed up in some of the
discussion following comment #7

-> sorry I was not careful enough when I tested the proposed-package, this is
very embarassing :-(

-> it seems the bug needs to be reopened

Martin Pitt (pitti) wrote :

Ernst, is the reload vs. restart issue really related to this bug? This was about doing DNS checks, not a bug in the upstart script. Should there be a new bug report instead?

BTW, "reload" is not supposed to kill the daemon. For oneiric, "reload" should be fixed to actually work, instead of using "restart" instead. If that fix is easy, then it should be backported; if it's complex, then the "restart" workaround might be more appropriate for an SRU.

well, i guess originally this bug had been about 'reload' not working correctly (#7), but focus has shifted over time.

To keeps things simple I have created a new bug report for the remaining maverick problem at https://bugs.launchpad.net/ubuntu/+source/squid/+bug/809526

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in squid3 (Ubuntu Lucid):
status: New → Confirmed
Changed in squid3 (Ubuntu Maverick):
status: New → Confirmed
Changed in squid3 (Ubuntu):
status: New → Confirmed
Rolf Leggewie (r0lf) wrote :

maverick has seen the end of its life and is no longer receiving any updates. Marking the maverick task for this ticket as "Won't Fix".

Changed in squid3 (Ubuntu Maverick):
status: Confirmed → Won't Fix
Rolf Leggewie (r0lf) wrote :

lucid has seen the end of its life and is no longer receiving any updates. Marking the lucid task for this ticket as "Won't Fix".

Changed in squid3 (Ubuntu Lucid):
status: Confirmed → Won't Fix
Tiago Stürmer Daitx (tdaitx) wrote :

This issue was marked as fixed by an earlier release.

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

Other bug subscribers