Merge ~bryce/ubuntu/+source/apache2:sru-lp1832182-graceful-xenial into ubuntu/+source/apache2:ubuntu/xenial-devel

Proposed by Bryce Harrington
Status: Merged
Approved by: Bryce Harrington
Approved revision: a6873885675d0b34f76c9e7baac224c4f6da79cd
Merge reported by: Christian Ehrhardt 
Merged at revision: a6873885675d0b34f76c9e7baac224c4f6da79cd
Proposed branch: ~bryce/ubuntu/+source/apache2:sru-lp1832182-graceful-xenial
Merge into: ubuntu/+source/apache2:ubuntu/xenial-devel
Diff against target: 80 lines (+43/-3)
2 files modified
debian/apache2ctl (+36/-3)
debian/changelog (+7/-0)
Reviewer Review Type Date Requested Status
Christian Ehrhardt  (community) Approve
git-ubuntu developers Pending
Canonical Server Pending
Review via email: mp+393678@code.launchpad.net

Description of the change

Backport to xenial of fix from
https://code.launchpad.net/~bryce/ubuntu/+source/apache2/+git/apache2/+merge/393426

In bionic and newer, the 'start' command has already been updated to work with systemd, but that fix appears to have not been backported to xenial. (I'm not certain why; guessing it's just an oversight?)

This branch backports that older fix along with this expansion of the fix to also cover the 'graceful' command.

PPA: https://launchpad.net/~bryce/+archive/ubuntu/apache2-sru-lp1832182
SRU: https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/1832182
Forwarded to Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=927302

n.b. I will be SRUing this branch along with a fix for https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/1899611, but doing this MP in isolation for review convenience.

To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

This MP only has the changelog commit - forgot something to push?

Revision history for this message
Christian Ehrhardt  (paelzer) :
review: Needs Fixing
826c7d3... by Bryce Harrington

  * d/apache2ctl: Use systemd for start and graceful if in use.
    (LP: #1832182)

Revision history for this message
Bryce Harrington (bryce) wrote :

Thanks for catching that. This branch is slightly different from the others in that it didn't have the prior fix for start, and I just forgot to commit the combined changes.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

In regard to the discussion we had in the MPs for newer releases - in Xenial start didn't issue the messages yet. We could now either go:
a) on the SRU let us not add stdout messages to start&graceful
or
b) let us add the same that was added in later releases (matches what is proposed right now)

Should we maybe get an SRU member to comment on their preference before uploading to proposed?

+1 from the MP review POV.

review: Approve
Revision history for this message
Bryce Harrington (bryce) wrote :

I've gone ahead and uploaded it. Since the messages print only for the currently bugged case I don't think the extra verbosity is going to be an issue. But I'll mention it in the SRU to highlight the situation for the SRU reviewer. I'm combining this with the conf file fix for MP 1899611 so there may end up being some discussion on this already.

Thanks again for the reviews.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

This has been merged, pushed to proposed and removed from there again.
Never the less in regard to the MP - this is merged.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/apache2ctl b/debian/apache2ctl
index 63db198..845b40c 100755
--- a/debian/apache2ctl
+++ b/debian/apache2ctl
@@ -131,6 +131,18 @@ mkdir_chown () {
131 fi131 fi
132}132}
133133
134need_systemd () {
135 # Detect if systemd is in use and should be used for managing
136 # the Apache2 httpd service. Returns 0 if so, 1 otherwise.
137 if [ -z "${APACHE_STARTED_BY_SYSTEMD}" ]; then
138 case "$(readlink -f /proc/1/exe)" in
139 *systemd*)
140 return 0
141 ;;
142 esac
143 fi
144 return 1
145}
134146
135[ ! -d ${APACHE_RUN_DIR:-/var/run/apache2} ] && mkdir -p ${APACHE_RUN_DIR:-/var/run/apache2}147[ ! -d ${APACHE_RUN_DIR:-/var/run/apache2} ] && mkdir -p ${APACHE_RUN_DIR:-/var/run/apache2}
136[ ! -d ${APACHE_LOCK_DIR:-/var/lock/apache2} ] && mkdir_chown ${APACHE_RUN_USER:-www-data} ${APACHE_LOCK_DIR:-/var/lock/apache2}148[ ! -d ${APACHE_LOCK_DIR:-/var/lock/apache2} ] && mkdir_chown ${APACHE_RUN_USER:-www-data} ${APACHE_LOCK_DIR:-/var/lock/apache2}
@@ -140,7 +152,18 @@ start)
140 # ssl_scache shouldn't be here if we're just starting up.152 # ssl_scache shouldn't be here if we're just starting up.
141 # (this is bad if there are several apache2 instances running)153 # (this is bad if there are several apache2 instances running)
142 rm -f ${APACHE_RUN_DIR:-/var/run/apache2}/*ssl_scache*154 rm -f ${APACHE_RUN_DIR:-/var/run/apache2}/*ssl_scache*
143 $HTTPD ${APACHE_ARGUMENTS} -k $ARGV155
156 if need_systemd; then
157 # If running on systemd we should not start httpd without systemd
158 # or systemd will get confused about the status of httpd.
159 echo "Invoking 'systemctl start ${APACHE_SYSTEMD_SERVICE}'."
160 echo "Use 'systemctl status ${APACHE_SYSTEMD_SERVICE}' for more info."
161 systemctl start "${APACHE_SYSTEMD_SERVICE}"
162 else
163 unset APACHE_STARTED_BY_SYSTEMD
164 ${HTTPD} ${APACHE_ARGUMENTS} -k "${ARGV}"
165 fi
166
144 ERROR=$?167 ERROR=$?
145 ;;168 ;;
146stop|graceful-stop)169stop|graceful-stop)
@@ -149,9 +172,19 @@ stop|graceful-stop)
149 ;;172 ;;
150restart|graceful)173restart|graceful)
151 if $HTTPD ${APACHE_ARGUMENTS} -t 2> /dev/null ; then174 if $HTTPD ${APACHE_ARGUMENTS} -t 2> /dev/null ; then
152 $HTTPD ${APACHE_ARGUMENTS} -k $ARGV175 if need_systemd; then
176 # If running on systemd we should not directly restart httpd since
177 # systemd would be confused about httpd's status.
178 # (See LP: #1832182)
179 echo "Invoking 'systemctl restart ${APACHE_SYSTEMD_SERVICE}'."
180 echo "Use 'systemctl status ${APACHE_SYSTEMD_SERVICE}' for more info."
181 systemctl restart "${APACHE_SYSTEMD_SERVICE}"
182 else
183 unset APACHE_STARTED_BY_SYSTEMD
184 ${HTTPD} ${APACHE_ARGUMENTS} -k "${ARGV}"
185 fi
153 else186 else
154 $HTTPD ${APACHE_ARGUMENTS} -t187 ${HTTPD} ${APACHE_ARGUMENTS} -t
155 fi188 fi
156 ERROR=$?189 ERROR=$?
157 ;;190 ;;
diff --git a/debian/changelog b/debian/changelog
index 659f7b8..502810f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
1apache2 (2.4.18-2ubuntu3.18) xenial; urgency=medium
2
3 * d/apache2ctl: Use systemd for start and graceful if in use.
4 (LP: #1832182)
5
6 -- Bryce Harrington <bryce@canonical.com> Fri, 13 Nov 2020 01:36:15 +0000
7
1apache2 (2.4.18-2ubuntu3.17) xenial-security; urgency=medium8apache2 (2.4.18-2ubuntu3.17) xenial-security; urgency=medium
29
3 * SECURITY UPDATE: mod_rewrite redirect issue10 * SECURITY UPDATE: mod_rewrite redirect issue

Subscribers

People subscribed via source and target branches