Merge lp://qastaging/~clint-fewbar/ubuntu/lucid/squid/fix-upgrades-after-reload into lp://qastaging/ubuntu/lucid/squid

Proposed by Clint Byrum
Status: Needs review
Proposed branch: lp://qastaging/~clint-fewbar/ubuntu/lucid/squid/fix-upgrades-after-reload
Merge into: lp://qastaging/ubuntu/lucid/squid
Diff against target: 56 lines (+38/-0)
2 files modified
debian/changelog (+7/-0)
debian/preinst (+31/-0)
To merge this branch: bzr merge lp://qastaging/~clint-fewbar/ubuntu/lucid/squid/fix-upgrades-after-reload
Reviewer Review Type Date Requested Status
Chuck Short (community) Approve
Review via email: mp+49741@code.qastaging.launchpad.net

Description of the change

This branch fixes the problem by checking to see if the problem the recent update is trying to correct has actually happened, and if so, doing a stop/start on the service using invoke-rc.d Between the stop/start, it also kills the errant pid (but only if invoke-rc.d worked, so policy is still respected).

I test this on a lucid vm in the following scenarios:

* bare bones no updates with just 'apt-get install squid' version 2.7.STABLE7-1ubuntu12
 - When preinst is run, the upstart pid and the pidfile agree, and so it exits doing nothing.

* same, but also running 'sudo reload squid', verifying that squid is not tracked by upstart anymore with 'status squid' showing stop/waiting, but 'ps auxw | grep squid' showing a running squid.
 - the job is stopped, the old squid is killed, squid is started again

* start squid, reload, kill -9, leaving stale pid file.
 - Code stops because /proc/`cat pidfile` does not exist.

* modify /etc/init/squid.conf to not use expect fork, and pass -N (basically manually putting in the new job file). This simulates the chance that a user may have applied the fix manually.
 - Code stops because the upstart pid matches the pidfile.

* stopped service before hand
 - pidfile is gone, code is not run

* removed upstart file
 - code checks for that, does not run.

To post a comment you must log in.
Revision history for this message
Chuck Short (zulcss) wrote :

Looks good to me, however can you put the info in the bug report as well. ;)
chuck

review: Approve

Unmerged revisions

53. By Clint Byrum

Detect and deal with the situation where upstart has lost track of
squid. (LP: #717397)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: