squid upstart script doesn't check for filesystems

Bug #831628 reported by Alec Kojaev on 2011-08-22
This bug affects 1 person
Affects Status Importance Assigned to Milestone
squid (Ubuntu)

Bug Description

Upstart script in current Natty squid (2.7.STABLE9-2.1ubuntu6) doesn't have either "local-filesystems" or "remote-filesystems" in its start condition. As a result, squid attempts to start during long initial fsck, respawns many times, and, finally, fails to start at all.

Old init script had in preconditions:

    # Required-Start: $network $remote_fs $syslog

where new upstart script has only:

    start on runlevel [2345] or net-device-up IFACE!=lo

Related branches

Dave Walker (davewalker) on 2011-08-24
Changed in squid (Ubuntu):
importance: Undecided → Low
tags: added: server-o-rs
Changed in squid (Ubuntu):
status: New → Confirmed
Dave Gilbert (ubuntu-treblig) wrote :

Hmm I wonder if this is what I'm seeing, I run a local squid on my desktop (and push apt through it so that all my machines only download once).

In the last few weeks of oneiric I've noticed accesses to squid after boot, hang until it's restarted.

There is a squid process:

proxy 1293 1 0 23:40 ? 00:00:00 /usr/sbin/squid -N -D

but the only log file that's changing is the /v/l/squid/cache.log that has:

2011/08/24 23:40:41| Starting Squid Cache version 2.7.STABLE9 for x86_64-pc-linux-gnu...
2011/08/24 23:40:41| Process ID 1293
2011/08/24 23:40:41| With 1024 file descriptors available
2011/08/24 23:40:41| Using epoll for the IO loop
2011/08/24 23:40:41| DNS Socket created at, port 51449, FD 6
2011/08/24 23:40:41| Warning: Could not find any nameservers. Trying to use localhost
2011/08/24 23:40:41| Please check your /etc/resolv.conf file
2011/08/24 23:40:41| or use the 'dns_nameservers' option in squid.conf.
2011/08/24 23:40:41| User-Agent logging is disabled.
2011/08/24 23:40:41| Referer logging is disabled.
2011/08/24 23:40:41| logfileOpen: opening log /var/log/squid/access.log
2011/08/24 23:40:41| Unlinkd pipe opened on FD 11
2011/08/24 23:40:41| Swap maxSize 2097152 + 8192 KB, estimated 161949 objects
2011/08/24 23:40:41| Target number of buckets: 8097
2011/08/24 23:40:41| Using 8192 Store buckets
2011/08/24 23:40:41| Max Mem size: 8192 KB
2011/08/24 23:40:41| Max Swap size: 2097152 KB
2011/08/24 23:40:41| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2011/08/24 23:40:41| logfileOpen: opening log /var/log/squid/store.log
2011/08/24 23:40:41| Rebuilding storage in /var/spool/squid (DIRTY)
2011/08/24 23:40:41| Using Least Load store dir selection
2011/08/24 23:40:41| Set Current Directory to /var/spool/squid
2011/08/24 23:40:41| Loaded Icons.
2011/08/24 23:40:43| Accepting proxy HTTP connections at, port 3128, FD 13.
2011/08/24 23:40:43| Accepting ICP messages at, port 3130, FD 14.
2011/08/24 23:40:43| HTCP Disabled.
2011/08/24 23:40:43| WCCP Disabled.
2011/08/24 23:40:43| Ready to serve requests.
2011/08/24 23:40:43| Done reading /var/spool/squid swaplog (2810 entries)
2011/08/24 23:40:43| Finished rebuilding storage from disk.
2011/08/24 23:40:43| 2810 Entries scanned
2011/08/24 23:40:43| 0 Invalid entries.
2011/08/24 23:40:43| 0 With invalid flags.
2011/08/24 23:40:43| 2810 Objects loaded.
2011/08/24 23:40:43| 0 Objects expired.
2011/08/24 23:40:43| 0 Objects cancelled.
2011/08/24 23:40:43| 0 Duplicate URLs purged.
2011/08/24 23:40:43| 0 Swapfile clashes avoided.
2011/08/24 23:40:43| Took 2.4 seconds (1147.1 objects/sec).
2011/08/24 23:40:43| Beginning Validation Procedure
2011/08/24 23:40:43| Completed Validation Procedure
2011/08/24 23:40:43| Validated 2810 Entries
2011/08/24 23:40:43| store_swap_size = 1878724k
2011/08/24 23:40:44| storeLateRelease: released 0 objects

Changed in squid (Ubuntu):
assignee: nobody → Ben Howard (utlemming)
milestone: none → ubuntu-11.10-beta-2
Changed in squid (Ubuntu):
status: Confirmed → In Progress

Fix tested and submitted. Pending review.

Changed in squid (Ubuntu):
status: In Progress → Fix Committed
Alec Kojaev (the-old-nomad) wrote :

One small note: previously the script contained:

# The second "or" condition is to start squid in case it failed to start
# because no real interface was there.
start on runlevel [2345] or net-device-up IFACE!=lo

Proposed fix changes this to:

start on runlevel [2345] and local-filesystems and net-device-up IFACE!=lo

If I read this right, previously squid was started when runlevel changed _or_ netword device went up; new version starts squid when runlevel changes _and_ network device goes up.

Perhaps a better fix would be something like:

start on local-filesystems and (runlevel [2345] or net-device-up IFACE!=lo)

Clint Byrum (clint-fewbar) wrote :

Right, I think the start on needs to be simplified even further.

runlevel [2345] in oneiric and later implies that all network interfaces listed in /etc/network/interfaces are up. So we can just take any mention of networking out. This does mean that if you have a desktop and you try to bind your squid to a specific interface, you won't get squid to automatically start for you, but thats ok, I think this is a corner case, and just complicates what should be much simpler.

Also runlevel [2345] implies 'filesystem', meaning all fsck's / mounts are done. So really just this:

start on runlevel [2345]

Also the fix, recently uploaded, regresses bug #561779

Merge request deleted.

Excerpts from Ben Howard's message of Wed Sep 07 16:54:54 UTC 2011:
> Merge request deleted.

Ben, your change was already uploaded.. can you submit a new one with the fix?

Clint, merge request submitted.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package squid - 2.7.STABLE9-4ubuntu4

squid (2.7.STABLE9-4ubuntu4) oneiric; urgency=low

  * debian/squid.upstart:
    - Revert "start after network and local file systems" as a regression
      to (LP: #561779). (LP: #831628)
 -- Ben Howard <email address hidden> Mon, 19 Sep 2011 14:41:47 -0700

Changed in squid (Ubuntu):
status: Fix Committed → Fix Released
tags: added: regression-update
Rolf Leggewie (r0lf) wrote :

Maverick has long since stopped to receive any updates. Marking the Maverick task for this ticket as "Won't Fix".

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

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

Changed in squid (Ubuntu Natty):
status: New → 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 squid (Ubuntu Lucid):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers