You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2020/02/11 16:20:00 UTC

svn commit: r1873914 - in /httpd/httpd/branches/2.4.x: ./ docs/manual/mod/mod_systemd.xml

Author: jorton
Date: Tue Feb 11 16:20:00 2020
New Revision: 1873914

URL: http://svn.apache.org/viewvc?rev=1873914&view=rev
Log:
Merge r1873835, r1873889 from trunk:

mod_systemd.xml: add basic unit example [skip ci]

Add some blurb on correctly stopping the service w/mod_systemd. [skip ci]

Submitted by: elukey, jorton

Modified:
    httpd/httpd/branches/2.4.x/   (props changed)
    httpd/httpd/branches/2.4.x/docs/manual/mod/mod_systemd.xml

Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1873835,1873889

Modified: httpd/httpd/branches/2.4.x/docs/manual/mod/mod_systemd.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/manual/mod/mod_systemd.xml?rev=1873914&r1=1873913&r2=1873914&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/mod/mod_systemd.xml (original)
+++ httpd/httpd/branches/2.4.x/docs/manual/mod/mod_systemd.xml Tue Feb 11 16:20:00 2020
@@ -36,6 +36,41 @@
     href="https://www.freedesktop.org/software/systemd/man/systemd.service.html">systemd.service(5)</a>
     for more information).  The module is activated if loaded.</p>
 
+    <example>
+    <title>Example of systemd service unit (more settings are probably needed for production systems)</title>
+    <pre>
+[Unit]
+Description=The Apache HTTP Server
+After=network.target
+
+[Service]
+Type=notify
+ExecStart=/usr/local/apache2/bin/httpd -D FOREGROUND -k start
+ExecReload=/usr/local/apache2/bin/httpd -k graceful
+KillMode=mixed
+
+[Install]
+WantedBy=multi-user.target
+    </pre>
+    </example>
+
+   <p>Special attention should be given to how <code>ExecStop</code>
+   and/or <code>KillMode</code> are configured for the service.  If
+   configured, an <code>ExecStop</code> command should be a
+   <em>synchronous operation</em> which itself exits when the daemon
+   has terminated.  Running <code>httpd -k stop</code>
+   <em>asynchronously</em> initiates daemon termination, so does not
+   satisfy this condition.  The example above uses
+   <code>KillMode=mixed</code> so that systemd sends
+   <code>SIGTERM</code> to signal the parent process (and only the
+   parent) to shut down.  The entire process group is then sent
+   <code>SIGKILL</code> after <code>TimeoutStopSec</code> elapses, if
+   any processes are still running.  See <a
+   href="https://www.freedesktop.org/software/systemd/man/systemd.kill.html">systemd.kill(5)</a>
+   for more information.</p>
+    
+   <p>This module does not provide support for Systemd socket activation.</p>
+
     <p><directive module="core">ExtendedStatus</directive> is
     enabled by default if the module is loaded.  If <directive
     module="core">ExtendedStatus</directive> is not disabled in