mod_systemd Provides better support for systemd integration Extension mod_systemd.c systemd_module

This module provides support for systemd integration. It allows starting httpd as a service with systemd Type=notify (see systemd.service(5) manual page for more information). It also provides statistics in systemctl status output and adds various directives useful for systemd integration.

IdleShutdown Enable shutting down the httpd when it is idle for some time. IdleShutdown seconds IdleShutdown 0 server config

The IdleShutdown directive enables shutting down the httpd when it is idle for some time. The idleness is based on bytes served, so if there are no bytes sent for some time defined by this directive, httpd will shutdown. By default, IdleShutdown is set to 0 meaning this feature is disabled.

This feature is useful in a combination with systemd socket activation (see systemd.socket(5) manual page). When httpd is started by systemd on some request, using this directive you can stop the httpd automatically when all the requests are served.

Implementation warning

Because of implementation details, idleness is checked only every 10 seconds. That means that if you specify IdleShutdown 14, httpd will stop itself after 20 seconds of idleness.