Merge lp://qastaging/~clint-fewbar/ubuntu/lucid/squid/fix-upgrades-after-reload into lp://qastaging/ubuntu/lucid/squid
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 |
Related bugs: |
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-
- 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/
- 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.
Unmerged revisions
- 53. By Clint Byrum
-
Detect and deal with the situation where upstart has lost track of
squid. (LP: #717397)
Looks good to me, however can you put the info in the bug report as well. ;)
chuck