The branch lp:~clint-fewbar/ubuntu/lucid/fix-upgrades-after-reload 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.
Since creating the merge proposal I also tried testing it with a /usr/sbin/policy-rc.d that exitted with 102, the appropriate way to disable a service's stop/starting, and the code was skipped. When the policy-rc.d returned 0, the code worked as intended (invoke-rc.d's behavior was basically unchanged).
The branch lp:~clint-fewbar/ubuntu/lucid/fix-upgrades-after-reload 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.
Since creating the merge proposal I also tried testing it with a /usr/sbin/ policy- rc.d that exitted with 102, the appropriate way to disable a service's stop/starting, and the code was skipped. When the policy-rc.d returned 0, the code worked as intended (invoke-rc.d's behavior was basically unchanged).