CINXE.COM

Comment #16 : Bug #1832182 : Bugs : apache2 package : Ubuntu

<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> <head> <base href="https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/1832182/comments/16/+index" /> <meta charset="UTF-8" /> <title>Comment #16 : Bug #1832182 : Bugs : apache2 package : Ubuntu</title> <link rel="apple-touch-icon" sizes="180x180" href="/@@/apple-touch-icon.png?v=2022" /> <link rel="icon" type="image/png" sizes="32x32" href="/@@/favicon-32x32.png?v=2022" /> <link rel="icon" type="image/png" sizes="16x16" href="/@@/favicon-16x16.png?v=2022" /> <link rel="manifest" href="/@@/site.webmanifest?v=2022" /> <link rel="mask-icon" href="/@@/safari-pinned-tab.svg?v=2022" color="#e9531f" /> <link rel="shortcut icon" href="/@@/favicon.ico?v=2022" /> <meta name="msapplication-TileColor" content="#da532c" /> <meta name="msapplication-config" content="/@@/browserconfig.xml?v=2022" /> <meta name="theme-color" content="#ffffff" /> <link type="text/css" rel="stylesheet" media="screen, print" href="/+icing/rev22ade00ab50b929fac63b8ee7252243aceda294a/combo.css" /> <meta name="description" content="Cool, glad to hear that an issue I uncovered has been fixed...a little confused as to why an official fix took 18 months to deploy though, considering it took me about 18 minutes. On Fri, Nov 27, 2020 at 8:42 AM Timo Aaltonen &lt;...&gt; wrote: &gt; Hello RedScourge, or anyone else affected, &gt; &gt; Accepted apache2 into focal-proposed. The package will build now and be &gt; available at &gt; https://launchpad.net/ubuntu/+source/apache2/2.4.41-4ubuntu3.2 in a few &gt; hours, and then in the -proposed repository...." /> <meta property="og:description" content="Cool, glad to hear that an issue I uncovered has been fixed...a little confused as to why an official fix took 18 months to deploy though, considering it took me about 18 minutes. On Fri, Nov 27, 2020 at 8:42 AM Timo Aaltonen &lt;...&gt; wrote: &gt; Hello RedScourge, or anyone else affected, &gt; &gt; Accepted apache2 into focal-proposed. The package will build now and be &gt; available at &gt; https://launchpad.net/ubuntu/+source/apache2/2.4.41-4ubuntu3.2 in a few &gt; hours, and then in the -proposed repository...." /> <meta property="og:title" content="Comment #16 : Bug #1832182 : Bugs : apache2 package : Ubuntu" /> <meta property="og:type" content="website" /> <meta property="og:image" content="/@@/launchpad-og-image.png" /> <meta property="og:url" content="https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/1832182/comments/16/+index" /> <meta property="og:site_name" content="Launchpad" /> <script type="text/javascript"> var LP = { cache: {}, links: {} }; </script> <script type="text/javascript">var cookie_scope = '; Path=/; Secure; Domain=.launchpad.net';</script> <script type="text/javascript" src="/+combo/rev22ade00ab50b929fac63b8ee7252243aceda294a/?yui/yui/yui-min.js&amp;lp/meta.js&amp;yui/loader/loader-min.js"></script> <script type="text/javascript"> var raw = null; if (LP.devmode) { raw = 'raw'; } YUI.GlobalConfig = { combine: true, comboBase: '/+combo/rev22ade00ab50b929fac63b8ee7252243aceda294a/?', root: 'yui/', filter: raw, debug: false, fetchCSS: false, maxURLLength: 2000, groups: { lp: { combine: true, base: '/+combo/rev22ade00ab50b929fac63b8ee7252243aceda294a/?lp/', comboBase: '/+combo/rev22ade00ab50b929fac63b8ee7252243aceda294a/?', root: 'lp/', // comes from including lp/meta.js modules: LP_MODULES, fetchCSS: false } } }</script> <script type="text/javascript"> // we need this to create a single YUI instance all events and code // talks across. All instances of YUI().use should be based off of // LPJS instead. var LPJS = new YUI(); </script> <script id="base-layout-load-scripts" type="text/javascript"> //<![CDATA[ LPJS.use('base', 'node', 'console', 'event', 'oop', 'lp', 'lp.app.foldables','lp.app.sorttable', 'lp.app.inlinehelp', 'lp.app.links', 'lp.bugs.bugtask_index', 'lp.bugs.subscribers', 'lp.app.ellipsis', 'lp.code.branchmergeproposal.diff', 'lp.views.global', function(Y) { Y.on("domready", function () { var global_view = new Y.lp.views.Global(); global_view.render(); Y.lp.app.sorttable.SortTable.init(); Y.lp.app.inlinehelp.init_help(); Y.lp.activate_collapsibles(); Y.lp.app.foldables.activate(); Y.lp.app.links.check_valid_lp_links(); }); Y.on('lp:context:web_link:changed', function(e) { window.location = e.new_value; }); }); //]]> </script> <script id="base-helper-functions" type="text/javascript"> //<![CDATA[ // This code is pulled from lp.js that needs to be available on every // request. Pulling here to get it outside the scope of the YUI block. function setFocusByName(name) { // Focus the first element matching the given name which can be focused. var nodes = document.getElementsByName(name); var i, node; for (i = 0; i < nodes.length; i++) { node = nodes[i]; if (node.focus) { try { // Trying to focus a hidden element throws an error in IE8. if (node.offsetHeight !== 0) { node.focus(); } } catch (e) { LPJS.use('console', function(Y) { Y.log('In setFocusByName(<' + node.tagName + ' type=' + node.type + '>): ' + e); }); } break; } } } function selectWidget(widget_name, event) { if (event && (event.keyCode === 9 || event.keyCode === 13)) { // Avoid firing if user is tabbing through or simply pressing // enter to submit the form. return; } document.getElementById(widget_name).checked = true; } //]]> </script> </head> <body id="document" itemscope="" itemtype="http://schema.org/WebPage" class="tab-bugs main_only public yui3-skin-sam"> <div class="yui-d0"> <div id="locationbar" class="login-logout"> <div id="logincontrol"><a href="https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/1832182/comments/16/+login">Log in / Register</a></div> </div><!--id="locationbar"--> <div id="watermark" class="watermark-apps-portlet"> <div> <a href="https://launchpad.net/ubuntu"><img alt="" width="64" height="64" src="https://launchpadlibrarian.net/606381979/CoF%2064px.png" /></a> </div> <div class="wide"> <h2 id="watermark-heading"><a href="https://launchpad.net/ubuntu">Ubuntu</a><br /><a href="https://launchpad.net/ubuntu/+source/apache2">apache2 package</a></h2> </div> <!-- Application Menu --> <ul class="facetmenu"> <li class="overview"><a href="https://launchpad.net/ubuntu/+source/apache2">Overview</a></li> <li class="branches"><a href="https://code.launchpad.net/ubuntu/+source/apache2">Code</a></li> <li class="bugs active"><a href="https://bugs.launchpad.net/ubuntu/+source/apache2">Bugs</a></li> <li class="specifications disabled-tab"><span>Blueprints</span></li> <li class="translations"><a href="https://translations.launchpad.net/ubuntu/+source/apache2">Translations</a></li> <li class="answers"><a href="https://answers.launchpad.net/ubuntu/+source/apache2">Answers</a></li> </ul> </div> <div id="maincontent" class="yui-main"> <div class="yui-b" dir="ltr"> <div class="context-publication"> <ol itemprop="breadcrumb" class="breadcrumbs"> <li> <a href="https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/1832182">Bug #1832182</a> </li> <li> Comment #16 </li> </ol> <div id="registration" class="registering"> </div> </div> <div id="request-notifications"> </div> <div itemprop="mainContentOfPage"> <h1>Comment 16 for bug 1832182</h1> <div xmlns="http://www.w3.org/1999/xhtml" itemscope="" itemtype="http://schema.org/UserComments" class="boardComment editable-message " data-baseurl="/ubuntu/+source/apache2/+bug/1832182/comments/16" data-i-can-edit="False"> <div class="boardCommentDetails"> <div class="message-revision-container"> <div class="message-revision-container-header"> <span>Revision history for this message</span> <img src="/+icing/build/overlay/assets/skins/sam/images/close.gif" class="message-revision-close" /> </div> <script type="text/template"> <div class='message-revision-item'> <div class='message-revision-title'> <a class="sprite remove action-icon message-revision-del-btn"> Remove </a> <a class="js-action"> Revision #{revision}, created at {date_created_display} </a> </div> <div class='message-revision-body'>{content}</div> </div> </script> <div class="message-revision-list"></div> </div> <table> <tbody> <tr> <td> <a href="https://launchpad.net/~redscourge" class="sprite person">RedScourge (redscourge)</a> wrote <time itemprop="commentTime" datetime="2020-11-27T16:51:18+00:00" title="2020-11-27 16:51:18 UTC">on 2020-11-27</time><span class="editable-message-last-edit-date">: </span> <a href="/ubuntu/+source/apache2/+bug/1832182/comments/16"> <strong>Re: [Bug 1832182] Please test proposed package</strong> </a> </td> <td> </td> <td> </td> <td class="bug-comment-index"> <a itemprop="url" href="/ubuntu/+source/apache2/+bug/1832182/comments/16"> #16</a> </td> </tr> </tbody> </table> </div> <div class="boardCommentBody"> <div class="editable-message-body"> <div class="comment-text editable-message-text" itemprop="commentText"><p>Cool, glad to hear that an issue I uncovered has been fixed...a little<br /> confused as to why an official fix took 18 months to deploy though,<br /> considering it took me about 18 minutes.</p> <p>On Fri, Nov 27, 2020 at 8:42 AM Timo Aaltonen &lt;email address hidden&gt;<br /> wrote:</p> <p><span class="foldable-quoted">&gt; Hello RedScourge, or anyone else affected,<br /> &gt;<br /> &gt; Accepted apache2 into focal-proposed. The package will build now and be<br /> &gt; available at<br /> &gt; <a rel="nofollow" href="https://launchpad.net/ubuntu/+source/apache2/2.4.41-4ubuntu3.2">https:/<wbr />/launchpad.<wbr />net/ubuntu/<wbr />+source/<wbr />apache2/<wbr />2.4.41-<wbr />4ubuntu3.<wbr />2</a> in a few<br /> &gt; hours, and then in the -proposed repository.<br /> &gt;<br /> &gt; Please help us by testing this new package. See<br /> &gt; <a rel="nofollow" href="https://wiki.ubuntu.com/Testing/EnableProposed">https:/<wbr />/wiki.ubuntu.<wbr />com/Testing/<wbr />EnableProposed</a> for documentation on how<br /> &gt; to enable and use -proposed. Your feedback will aid us getting this<br /> &gt; update out to other Ubuntu users.<br /> &gt;<br /> &gt; If this package fixes the bug for you, please add a comment to this bug,<br /> &gt; mentioning the version of the package you tested, what testing has been<br /> &gt; performed on the package and change the tag from verification-<wbr />needed-<br /> &gt; focal to verification-<wbr />done-focal. If it does not fix the bug for you,<br /> &gt; please add a comment stating that, and change the tag to verification-<br /> &gt; failed-focal. In either case, without details of your testing we will<br /> &gt; not be able to proceed.<br /> &gt;<br /> &gt; Further information regarding the verification process can be found at<br /> &gt; <a rel="nofollow" href="https://wiki.ubuntu.com/QATeam/PerformingSRUVerification">https:/<wbr />/wiki.ubuntu.<wbr />com/QATeam/<wbr />PerformingSRUVe<wbr />rification</a> . Thank you in<br /> &gt; advance for helping!<br /> &gt;<br /> &gt; N.B. The updated package will be released to -updates after the bug(s)<br /> &gt; fixed by this package have been verified and the package has been in<br /> &gt; -proposed for a minimum of 7 days.<br /> &gt;<br /> &gt; ** Tags added: verification-<wbr />needed-<wbr />bionic<br /> &gt;<br /> &gt; --<br /> &gt; You received this bug notification because you are subscribed to the bug<br /> &gt; report.<br /> &gt; <a rel="nofollow" href="https://bugs.launchpad.net/bugs/1832182">https:/<wbr />/bugs.launchpad<wbr />.net/bugs/<wbr />1832182</a><br /> &gt;<br /> &gt; Title:<br /> &gt; systemd unable to detect running apache if invoked via &quot;apache2ctl<br /> &gt; graceful&quot;<br /> &gt;<br /> &gt; Status in apache2 package in Ubuntu:<br /> &gt; Fix Committed<br /> &gt; Status in apache2 source package in Xenial:<br /> &gt; Fix Committed<br /> &gt; Status in apache2 source package in Bionic:<br /> &gt; Fix Committed<br /> &gt; Status in apache2 source package in Focal:<br /> &gt; Fix Committed<br /> &gt; Status in apache2 source package in Groovy:<br /> &gt; Fix Committed<br /> &gt; Status in apache2 source package in Hirsute:<br /> &gt; Fix Committed<br /> &gt; Status in apache2 package in Debian:<br /> &gt; New<br /> &gt;<br /> &gt; Bug description:<br /> &gt; [Impact]<br /> &gt;<br /> &gt; Unattended upgrade will attempt to gracefully reload the Apache2 httpd<br /> &gt; service, but it reloads apache directly, not via systemd, so systemctl<br /> &gt; will mis-report the true status. This can cause unexpected and<br /> &gt; unnecessary server outages when e.g. upgrading from one LTS to<br /> &gt; another.<br /> &gt;<br /> &gt;<br /> &gt; [Test Case]<br /> &gt;<br /> &gt; root@server:<wbr />/usr/local/<wbr />sbin# apache2ctl stop<br /> &gt; root@server:<wbr />/usr/local/<wbr />sbin# apache2ctl graceful<br /> &gt; httpd not running, trying to start<br /> &gt; root@server:<wbr />/usr/local/<wbr />sbin# systemctl status apache2.service<br /> &gt; ? apache2.service - The Apache HTTP Server<br /> &gt; Loaded: loaded (/lib/systemd/<wbr />system/<wbr />apache2.<wbr />service; enabled; vendor<br /> &gt; preset: enabled)<br /> &gt; Drop-In: /lib/systemd/<wbr />system/<wbr />apache2.<wbr />service.<wbr />d<br /> &gt; +-apache2-<wbr />systemd.<wbr />conf<br /> &gt; Active: inactive (dead) since Mon 2019-06-10 01:04:13 MDT; 17s ago<br /> &gt; Process: 27370 ExecStop=<wbr />/usr/sbin/<wbr />apachectl stop (code=exited,<br /> &gt; status=0/SUCCESS)<br /> &gt; Process: 11462 ExecReload=<wbr />/usr/sbin/<wbr />apachectl graceful (code=exited,<br /> &gt; status=0/SUCCESS)<br /> &gt; Main PID: 1849 (code=exited, status=0/SUCCESS)<br /> &gt;<br /> &gt; Jun 08 19:11:24 server apachectl[1408]: AH00112: Warning: DocumentRoot<br /> &gt; [/srv/apache2/<wbr />www/...<br /> &gt; Jun 08 19:11:24 server apachectl[1408]: AH00112: Warning: DocumentRoot<br /> &gt; [/srv/apache2/<wbr />www/...<br /> &gt; Jun 08 19:11:24 server apachectl[1408]: AH00112: Warning: DocumentRoot<br /> &gt; [/srv/apache2/<wbr />www/...<br /> &gt; Jun 08 19:11:24 server apachectl[1408]: AH00112: Warning: DocumentRoot<br /> &gt; [/srv/apache2/<wbr />www/...<br /> &gt; Jun 08 19:11:24 server apachectl[1408]: AH00112: Warning: DocumentRoot<br /> &gt; [/srv/apache2/<wbr />www/...<br /> &gt; Jun 08 19:11:24 server apachectl[1408]: AH00112: Warning: DocumentRoot<br /> &gt; [/srv/apache2/<wbr />www/...<br /> &gt; Jun 08 19:11:24 server systemd[1]: Started The Apache HTTP Server.<br /> &gt; Jun 09 06:25:04 server systemd[1]: Reloading The Apache HTTP Server.<br /> &gt; Jun 09 06:25:04 server systemd[1]: Reloaded The Apache HTTP Server.<br /> &gt; Jun 10 01:04:13 server apachectl[27370]: httpd (no pid file) not running<br /> &gt;<br /> &gt; Output after customizing the apache2ctl script and restarting it:<br /> &gt;<br /> &gt; root@server:<wbr />/usr/local/<wbr />sbin# apache2ctl_custom graceful<br /> &gt; Invoking &#x27;systemctl start apache2&#x27;.<br /> &gt; Use &#x27;systemctl status apache2&#x27; for more info.<br /> &gt; root@server:<wbr />/usr/local/<wbr />sbin# systemctl status apache2.service<br /> &gt; ? apache2.service - The Apache HTTP Server<br /> &gt; Loaded: loaded (/lib/systemd/<wbr />system/<wbr />apache2.<wbr />service; enabled; vendor<br /> &gt; preset: enabled)<br /> &gt; Drop-In: /lib/systemd/<wbr />system/<wbr />apache2.<wbr />service.<wbr />d<br /> &gt; +-apache2-<wbr />systemd.<wbr />conf<br /> &gt; Active: active (running) since Mon 2019-06-10 01:04:50 MDT; 4s ago<br /> &gt; Process: 27370 ExecStop=<wbr />/usr/sbin/<wbr />apachectl stop (code=exited,<br /> &gt; status=0/SUCCESS)<br /> &gt; Process: 11462 ExecReload=<wbr />/usr/sbin/<wbr />apachectl graceful (code=exited,<br /> &gt; status=0/SUCCESS)<br /> &gt; Process: 27432 ExecStart=<wbr />/usr/sbin/<wbr />apachectl start (code=exited,<br /> &gt; status=0/SUCCESS)<br /> &gt; Main PID: 27444 (apache2)<br /> &gt; Tasks: 6 (limit: 2318)<br /> &gt; CGroup: /system.<wbr />slice/apache2.<wbr />service<br /> &gt; +-27444 /usr/sbin/apache2 -k start<br /> &gt; +-27448 /usr/sbin/apache2 -k start<br /> &gt; +-27449 /usr/sbin/apache2 -k start<br /> &gt; +-27451 /usr/sbin/apache2 -k start<br /> &gt; +-27454 /usr/sbin/apache2 -k start<br /> &gt; +-27455 /usr/sbin/apache2 -k start<br /> &gt;<br /> &gt; Jun 10 01:04:50 server systemd[1]: Starting The Apache HTTP Server...<br /> &gt; Jun 10 01:04:50 server systemd[1]: Started The Apache HTTP Server.<br /> &gt;<br /> &gt; [Fix]<br /> &gt;<br /> &gt; The fix is made somewhat obvious due to the fact that the issue was<br /> &gt; fixed for &quot;apache2ctl start&quot; in 18.04 LTS by replacing the regular<br /> &gt; call (which resolves to &quot;/usr/sbin/apache2 -k start&quot;) with a check for<br /> &gt; presence of systemd, followed by an invocation of &quot;systemctl start<br /> &gt; apache2.service&quot; if that check is affirmative, or falling back to the<br /> &gt; old start command if that check is negative.<br /> &gt;<br /> &gt; Attached to this bug report is a diff of the file before and after I<br /> &gt; copied the fixed invocation from the &quot;start&quot; subsection to the<br /> &gt; &quot;graceful&quot; subsection in 18.04 LTS. A fix for 16.04 LTS would require<br /> &gt; copying that block both into the &quot;start&quot; and &quot;graceful&quot; subsections.<br /> &gt;<br /> &gt;<br /> &gt; [Regression Potential]<br /> &gt;<br /> &gt; This alters the behavior of Debian&#x27;s apache2ctl script for managing<br /> &gt; the service state. No other Apache2 code is modified. Thus things to<br /> &gt; watch for new regressions would deal with the apache service&#x27;s state<br /> &gt; itself, not crashes or behavioral changes.<br /> &gt;<br /> &gt; With a manual sysadmin-supervised service restart, if there are<br /> &gt; problems the sysadmin can intervene. The real risk of regression here<br /> &gt; would be for unsupervised or automated service updates.<br /> &gt;<br /> &gt;<br /> &gt; [Original Report]<br /> &gt;<br /> &gt; When starting or restarting Apache via the /usr/sbin/<wbr />apache2ctl<br /> &gt; script, systemd becomes unaware of the state of Apache, causing<br /> &gt; &quot;systemctl status apache2.service&quot; to report &quot;Active: inactive<br /> &gt; (dead)&quot;. Below I describe the issue and a fix; attached is the output<br /> &gt; of the diff command after I fixed it on my own 18.04 LTS system.<br /> &gt;<br /> &gt; Despite this issue, Apache itself generally runs fine, so this is not<br /> &gt; an absolutely critical issue, however as both &quot;systemctl status<br /> &gt; apache2.service&quot; and &quot;service apache2 status&quot; become unable to detect<br /> &gt; its running state, and as some people may be scripting Apache service<br /> &gt; checks using those commands, they may experience server outages when<br /> &gt; they migrate from 14.04 LTS to 16.04 LTS or 18.04 LTS, so this could<br /> &gt; potentially have serious consequences. I suspect this caused or at<br /> &gt; least contributed to at least one outage of a web server I am<br /> &gt; responsible for, as the web file backup script was unable to restart<br /> &gt; the apache process after stopping it.<br /> &gt;<br /> &gt; This issue affects Ubuntu 16.04 LTS when using &quot;apache2ctl start&quot; or<br /> &gt; &quot;apache2ctl graceful&quot;, and Ubuntu 18.04 LTS just when using<br /> &gt; &quot;apache2ctl graceful&quot;.<br /> &gt;<br /> &gt;<br /> &gt; [Additional information]<br /> &gt;<br /> &gt; lsb_release -rd :<br /> &gt;<br /> &gt; Description: Ubuntu 18.04.2 LTS<br /> &gt; Release: 18.04<br /> &gt;<br /> &gt; apt-cache policy apache2:<br /> &gt;<br /> &gt; apache2:<br /> &gt; Installed: 2.4.29-1ubuntu4.6<br /> &gt; Candidate: 2.4.29-1ubuntu4.6<br /> &gt;<br /> &gt; To manage notifications about this bug go to:<br /> &gt;<br /> &gt; <a rel="nofollow" href="https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/1832182/+subscriptions">https:/<wbr />/bugs.launchpad<wbr />.net/ubuntu/<wbr />+source/<wbr />apache2/<wbr />+bug/1832182/<wbr />+subscriptions</a><br /> &gt; </span></p></div> </div> <div class="editable-message-form" style="display: none"> <textarea style="width: 100%" rows="10">Cool, glad to hear that an issue I uncovered has been fixed...a little confused as to why an official fix took 18 months to deploy though, considering it took me about 18 minutes. On Fri, Nov 27, 2020 at 8:42 AM Timo Aaltonen &lt;1832182@bugs.launchpad.net&gt; wrote: &gt; Hello RedScourge, or anyone else affected, &gt; &gt; Accepted apache2 into focal-proposed. The package will build now and be &gt; available at &gt; https://launchpad.net/ubuntu/+source/apache2/2.4.41-4ubuntu3.2 in a few &gt; hours, and then in the -proposed repository. &gt; &gt; Please help us by testing this new package. See &gt; https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how &gt; to enable and use -proposed. Your feedback will aid us getting this &gt; update out to other Ubuntu users. &gt; &gt; If this package fixes the bug for you, please add a comment to this bug, &gt; mentioning the version of the package you tested, what testing has been &gt; performed on the package and change the tag from verification-needed- &gt; focal to verification-done-focal. If it does not fix the bug for you, &gt; please add a comment stating that, and change the tag to verification- &gt; failed-focal. In either case, without details of your testing we will &gt; not be able to proceed. &gt; &gt; Further information regarding the verification process can be found at &gt; https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in &gt; advance for helping! &gt; &gt; N.B. The updated package will be released to -updates after the bug(s) &gt; fixed by this package have been verified and the package has been in &gt; -proposed for a minimum of 7 days. &gt; &gt; ** Tags added: verification-needed-bionic &gt; &gt; -- &gt; You received this bug notification because you are subscribed to the bug &gt; report. &gt; https://bugs.launchpad.net/bugs/1832182 &gt; &gt; Title: &gt; systemd unable to detect running apache if invoked via "apache2ctl &gt; graceful" &gt; &gt; Status in apache2 package in Ubuntu: &gt; Fix Committed &gt; Status in apache2 source package in Xenial: &gt; Fix Committed &gt; Status in apache2 source package in Bionic: &gt; Fix Committed &gt; Status in apache2 source package in Focal: &gt; Fix Committed &gt; Status in apache2 source package in Groovy: &gt; Fix Committed &gt; Status in apache2 source package in Hirsute: &gt; Fix Committed &gt; Status in apache2 package in Debian: &gt; New &gt; &gt; Bug description: &gt; [Impact] &gt; &gt; Unattended upgrade will attempt to gracefully reload the Apache2 httpd &gt; service, but it reloads apache directly, not via systemd, so systemctl &gt; will mis-report the true status. This can cause unexpected and &gt; unnecessary server outages when e.g. upgrading from one LTS to &gt; another. &gt; &gt; &gt; [Test Case] &gt; &gt; root@server:/usr/local/sbin# apache2ctl stop &gt; root@server:/usr/local/sbin# apache2ctl graceful &gt; httpd not running, trying to start &gt; root@server:/usr/local/sbin# systemctl status apache2.service &gt; ? apache2.service - The Apache HTTP Server &gt; Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor &gt; preset: enabled) &gt; Drop-In: /lib/systemd/system/apache2.service.d &gt; +-apache2-systemd.conf &gt; Active: inactive (dead) since Mon 2019-06-10 01:04:13 MDT; 17s ago &gt; Process: 27370 ExecStop=/usr/sbin/apachectl stop (code=exited, &gt; status=0/SUCCESS) &gt; Process: 11462 ExecReload=/usr/sbin/apachectl graceful (code=exited, &gt; status=0/SUCCESS) &gt; Main PID: 1849 (code=exited, status=0/SUCCESS) &gt; &gt; Jun 08 19:11:24 server apachectl[1408]: AH00112: Warning: DocumentRoot &gt; [/srv/apache2/www/... &gt; Jun 08 19:11:24 server apachectl[1408]: AH00112: Warning: DocumentRoot &gt; [/srv/apache2/www/... &gt; Jun 08 19:11:24 server apachectl[1408]: AH00112: Warning: DocumentRoot &gt; [/srv/apache2/www/... &gt; Jun 08 19:11:24 server apachectl[1408]: AH00112: Warning: DocumentRoot &gt; [/srv/apache2/www/... &gt; Jun 08 19:11:24 server apachectl[1408]: AH00112: Warning: DocumentRoot &gt; [/srv/apache2/www/... &gt; Jun 08 19:11:24 server apachectl[1408]: AH00112: Warning: DocumentRoot &gt; [/srv/apache2/www/... &gt; Jun 08 19:11:24 server systemd[1]: Started The Apache HTTP Server. &gt; Jun 09 06:25:04 server systemd[1]: Reloading The Apache HTTP Server. &gt; Jun 09 06:25:04 server systemd[1]: Reloaded The Apache HTTP Server. &gt; Jun 10 01:04:13 server apachectl[27370]: httpd (no pid file) not running &gt; &gt; Output after customizing the apache2ctl script and restarting it: &gt; &gt; root@server:/usr/local/sbin# apache2ctl_custom graceful &gt; Invoking 'systemctl start apache2'. &gt; Use 'systemctl status apache2' for more info. &gt; root@server:/usr/local/sbin# systemctl status apache2.service &gt; ? apache2.service - The Apache HTTP Server &gt; Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor &gt; preset: enabled) &gt; Drop-In: /lib/systemd/system/apache2.service.d &gt; +-apache2-systemd.conf &gt; Active: active (running) since Mon 2019-06-10 01:04:50 MDT; 4s ago &gt; Process: 27370 ExecStop=/usr/sbin/apachectl stop (code=exited, &gt; status=0/SUCCESS) &gt; Process: 11462 ExecReload=/usr/sbin/apachectl graceful (code=exited, &gt; status=0/SUCCESS) &gt; Process: 27432 ExecStart=/usr/sbin/apachectl start (code=exited, &gt; status=0/SUCCESS) &gt; Main PID: 27444 (apache2) &gt; Tasks: 6 (limit: 2318) &gt; CGroup: /system.slice/apache2.service &gt; +-27444 /usr/sbin/apache2 -k start &gt; +-27448 /usr/sbin/apache2 -k start &gt; +-27449 /usr/sbin/apache2 -k start &gt; +-27451 /usr/sbin/apache2 -k start &gt; +-27454 /usr/sbin/apache2 -k start &gt; +-27455 /usr/sbin/apache2 -k start &gt; &gt; Jun 10 01:04:50 server systemd[1]: Starting The Apache HTTP Server... &gt; Jun 10 01:04:50 server systemd[1]: Started The Apache HTTP Server. &gt; &gt; [Fix] &gt; &gt; The fix is made somewhat obvious due to the fact that the issue was &gt; fixed for "apache2ctl start" in 18.04 LTS by replacing the regular &gt; call (which resolves to "/usr/sbin/apache2 -k start") with a check for &gt; presence of systemd, followed by an invocation of "systemctl start &gt; apache2.service" if that check is affirmative, or falling back to the &gt; old start command if that check is negative. &gt; &gt; Attached to this bug report is a diff of the file before and after I &gt; copied the fixed invocation from the "start" subsection to the &gt; "graceful" subsection in 18.04 LTS. A fix for 16.04 LTS would require &gt; copying that block both into the "start" and "graceful" subsections. &gt; &gt; &gt; [Regression Potential] &gt; &gt; This alters the behavior of Debian's apache2ctl script for managing &gt; the service state. No other Apache2 code is modified. Thus things to &gt; watch for new regressions would deal with the apache service's state &gt; itself, not crashes or behavioral changes. &gt; &gt; With a manual sysadmin-supervised service restart, if there are &gt; problems the sysadmin can intervene. The real risk of regression here &gt; would be for unsupervised or automated service updates. &gt; &gt; &gt; [Original Report] &gt; &gt; When starting or restarting Apache via the /usr/sbin/apache2ctl &gt; script, systemd becomes unaware of the state of Apache, causing &gt; "systemctl status apache2.service" to report "Active: inactive &gt; (dead)". Below I describe the issue and a fix; attached is the output &gt; of the diff command after I fixed it on my own 18.04 LTS system. &gt; &gt; Despite this issue, Apache itself generally runs fine, so this is not &gt; an absolutely critical issue, however as both "systemctl status &gt; apache2.service" and "service apache2 status" become unable to detect &gt; its running state, and as some people may be scripting Apache service &gt; checks using those commands, they may experience server outages when &gt; they migrate from 14.04 LTS to 16.04 LTS or 18.04 LTS, so this could &gt; potentially have serious consequences. I suspect this caused or at &gt; least contributed to at least one outage of a web server I am &gt; responsible for, as the web file backup script was unable to restart &gt; the apache process after stopping it. &gt; &gt; This issue affects Ubuntu 16.04 LTS when using "apache2ctl start" or &gt; "apache2ctl graceful", and Ubuntu 18.04 LTS just when using &gt; "apache2ctl graceful". &gt; &gt; &gt; [Additional information] &gt; &gt; lsb_release -rd : &gt; &gt; Description: Ubuntu 18.04.2 LTS &gt; Release: 18.04 &gt; &gt; apt-cache policy apache2: &gt; &gt; apache2: &gt; Installed: 2.4.29-1ubuntu4.6 &gt; Candidate: 2.4.29-1ubuntu4.6 &gt; &gt; To manage notifications about this bug go to: &gt; &gt; https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/1832182/+subscriptions &gt; </textarea> <input type="button" value="Update" class="editable-message-update-btn" /> <input type="button" value="Cancel" class="editable-message-cancel-btn" /> </div> </div> </div> </div> </div><!-- yui-b --> </div><!-- yui-main --> <!-- yui-b side --> <!-- yui-t4 --> <div id="footer" class="footer"> <div class="lp-arcana"> <div class="lp-branding"> <a href="https://launchpad.net/"><img src="/@@/launchpad-footer-logo.svg" alt="Launchpad" width="65" height="18" /></a> &nbsp;&bull;&nbsp; <a href="https://launchpad.net/+tour">Take the tour</a> &nbsp;&bull;&nbsp; <a href="https://help.launchpad.net/">Read the guide</a> &nbsp; <form id="globalsearch" method="get" accept-charset="UTF-8" action="https://launchpad.net/+search"> <input type="search" id="search-text" name="field.text" /> <input type="image" src="/@@/search" style="vertical-align:5%" alt="Search Launchpad" /> </form> </div> </div> <div class="colophon"> &copy; 2004 <a href="http://canonical.com/">Canonical&nbsp;Ltd.</a> &nbsp;&bull;&nbsp; <a href="https://launchpad.net/legal">Terms of use</a> &nbsp;&bull;&nbsp; <a href="https://www.ubuntu.com/legal/dataprivacy">Data privacy</a> &nbsp;&bull;&nbsp; <a href="/feedback">Contact Launchpad Support</a> &nbsp;&bull;&nbsp; <a href="http://blog.launchpad.net/">Blog</a> &nbsp;&bull;&nbsp; <a href="https://canonical.com/careers">Careers</a> &nbsp;&bull;&nbsp; <a href="https://ubuntu.social/@launchpadstatus">System status</a> <span id="lp-version"> &nbsp;&bull;&nbsp; 22ade00 (<a href="https://dev.launchpad.net/">Get the code!</a>) </span> </div> </div> </div><!-- yui-d0--> <script id="json-cache-script">LP.cache = {"related_features": {}, "context": {"self_link": "https://bugs.launchpad.net/api/devel/ubuntu/+source/apache2/+bug/1832182", "web_link": "https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/1832182", "resource_type_link": "https://bugs.launchpad.net/api/devel/#bug_task", "bug_link": "https://bugs.launchpad.net/api/devel/bugs/1832182", "milestone_link": null, "status": "Triaged", "status_explanation": null, "importance": "High", "importance_explanation": null, "assignee_link": null, "bug_target_display_name": "apache2 (Ubuntu)", "bug_target_name": "apache2 (Ubuntu)", "bug_watch_link": null, "date_assigned": null, "date_created": "2019-06-10T07:31:32.043912+00:00", "date_confirmed": "2019-06-11T19:32:11.828903+00:00", "date_incomplete": null, "date_in_progress": null, "date_closed": null, "date_left_new": "2019-06-11T19:32:11.828903+00:00", "date_triaged": "2019-06-11T19:32:11.828903+00:00", "date_fix_committed": null, "date_fix_released": null, "date_left_closed": "2021-10-14T11:10:13.839290+00:00", "owner_link": "https://bugs.launchpad.net/api/devel/~redscourge", "target_link": "https://bugs.launchpad.net/api/devel/ubuntu/+source/apache2", "title": "Bug #1832182 in apache2 (Ubuntu): \"systemd unable to detect running apache if invoked via \"apache2ctl graceful\"\"", "related_tasks_collection_link": "https://bugs.launchpad.net/api/devel/ubuntu/+source/apache2/+bug/1832182/related_tasks", "is_complete": false, "http_etag": "\"d0d53464ba0439326a82dabf67ea285335b8ec57-7edadbfc60c13d5c5acb58e9d65b30a494a20eee\""}};</script> </body> <!-- Facet name: bugs Page type: main_only Has global search: True Has application tabs: True Has side portlets: False At least 19 queries/external actions issued in 0.15 seconds Features: {'profiling.enabled': None, 'hard_timeout': '9000', 'js.yui_version': None, 'app.mainsite_only.canonical_url': None, 'app.maintenance_message': None, 'baselayout.careers_link.disabled': None, 'visible_render_time': None} r22ade00 --> </html>

Pages: 1 2 3 4 5 6 7 8 9 10