| Description: | Provides better support for systemd integration |
|---|---|
| Status: | Extension |
| Module Identifier: | systemd_module |
| Source File: | mod_systemd.c |
| Compatibility: | Available in Apache 2.4.42 and later |
This module provides support for systemd integration. It allows httpd to be used in a service with the systemdType=notify (seesystemd.service(5) for more information). The module is activated if loaded.
[Unit]Description=The Apache HTTP ServerAfter=network.target[Service]Type=notifyExecStart=/usr/local/apache2/bin/httpd -D FOREGROUND -k startExecReload=/usr/local/apache2/bin/httpd -k gracefulKillMode=mixed[Install]WantedBy=multi-user.target
Special attention should be given to howExecStop and/orKillMode are configured for the service. If configured, anExecStop command should be asynchronous operation which itself exits when the daemon has terminated. Runninghttpd -k stopasynchronously initiates daemon termination, so does not satisfy this condition. The example above usesKillMode=mixed so that systemd sendsSIGTERM to signal the parent process (and only the parent) to shut down. The entire process group is then sentSIGKILL afterTimeoutStopSec elapses, if any processes are still running. Seesystemd.kill(5) for more information.
This module does not provide support for Systemd socket activation.
ExtendedStatus is enabled by default if the module is loaded. IfExtendedStatus is not disabled in the configuration, run-time load and request statistics are made available in thesystemctl status output.
Copyright 2025 The Apache Software Foundation.
Licensed under theApache License, Version 2.0.