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

Proposed by Clint Byrum
Status: Merged
Merged at revision: 58
Proposed branch: lp:~clint-fewbar/ubuntu/natty/squid/fix-upgrades-after-reload
Merge into: lp:ubuntu/natty/squid
Diff against target: 55 lines (+37/-0)
2 files modified
debian/changelog (+7/-0)
debian/preinst (+30/-0)
To merge this branch: bzr merge lp:~clint-fewbar/ubuntu/natty/squid/fix-upgrades-after-reload
Reviewer Review Type Date Requested Status
Ubuntu Sponsors Pending
Review via email: mp+49918@code.launchpad.net

Description of the change

This is the same merge as the one proposed with lucid, except I've removed the check for what version we're upgrading from. Ultimately, this is a useful check no matter what, given that the user could have refused to merge the upstart job file if it has local changes.

I have not tested it as thorougly on natty as I did on lucid, though I did at least check to see that it installs and runs the code appropriately if the squid job has lost track of its squid daemon.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2011-01-11 10:49:37 +0000
+++ debian/changelog 2011-02-16 05:22:55 +0000
@@ -1,3 +1,10 @@
1squid (2.7.STABLE9-2.1ubuntu3) natty; urgency=low
2
3 * Detect and deal with the situation where upstart has lost track of
4 squid. (LP: #717397)
5
6 -- Clint Byrum <clint@ubuntu.com> Tue, 15 Feb 2011 07:00:38 -0800
7
1squid (2.7.STABLE9-2.1ubuntu2) natty; urgency=low8squid (2.7.STABLE9-2.1ubuntu2) natty; urgency=low
29
3 * Run squid with -N and drop 'expect fork' to prevent HUP's from10 * Run squid with -N and drop 'expect fork' to prevent HUP's from
411
=== modified file 'debian/preinst'
--- debian/preinst 2010-04-16 09:00:19 +0000
+++ debian/preinst 2011-02-16 05:22:55 +0000
@@ -52,6 +52,36 @@
52 chsh -s /bin/sh proxy52 chsh -s /bin/sh proxy
53fi53fi
5454
55# Because of this bug:
56# https://bugs.launchpad.net/bugs/573853
57# Upstart may have lost track of squid. Correct that by using the
58# pid file to stop it and then start the job back up
59if [ "$1" = "upgrade" ] \
60 && [ -f "/var/run/squid.pid" ] \
61 && [ -f "/etc/init/squid.conf" ]
62then
63 SQUID_PID=`cat /var/run/squid.pid`
64 # is this still running, and actually squid
65 if [ -d "/proc/${SQUID_PID}" ] \
66 && [ "`stat -L -c %D%i /proc/${SQUID_PID}/exe`" = "`stat -L -c %D%i /usr/sbin/squid`" ]
67 then
68 UPSTART_SQUID_PID=`initctl status squid | awk -F'process ' '/start\/running, process / { print $2 }'`
69 PIDFILE_PPID=`awk '{print $4}' /proc/$SQUID_PID/stat`
70 # If the user has disabled expect fork the pids will be the same
71 if [ "$UPSTART_SQUID_PID" != "$SQUID_PID" -a "$PIDFILE_PPID" != "$UPSTART_SQUID_PID" ]
72 then
73 # stop the job
74 if invoke-rc.d squid stop
75 then
76 # kill the pid file pid
77 kill ${SQUID_PID}
78 # start the job again
79 invoke-rc.d squid start
80 fi
81 fi
82 fi
83fi
84
55#DEBHELPER#85#DEBHELPER#
5686
57exit 087exit 0

Subscribers

People subscribed via source and target branches

to all changes: