[systemd-devel] Need help with setting up systemd for Apache on Debian 10

Reindl Harald h.reindl at thelounge.net
Sun Aug 23 17:26:40 UTC 2020



Am 23.08.20 um 19:19 schrieb Tom Browder:
> There is no official Apache systemd setup for Apache from source, and
> I didn't get any help from users there. I tried to mimic a good
> solution by first installing Apache with the Debian package and
> finding all the systemd files with "httpd" or "apache" in the name.
> That resulted in the following list:
> 
>     /etc/systemd/system/multi-user.target.wants/apache2.service
>     /run/systemd/units/invocation:apache2.service
>     /usr/lib/systemd/system/apache2.service
>     /var/lib/systemd/deb-systemd-helper-enabled/apache2.service.dsh-also
>     /var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants/apache2.service
> 
> The contents of the "apache2.service" file are:
> 
>     [Unit]
>     Description=The Apache HTTP Server
>     After=network.target remote-fs.target nss-lookup.target
> 
>     [Service]
>     Type=forking
>     Environment=APACHE_STARTED_BY_SYSTEMD=true
>     ExecStart=/usr/sbin/apachectl start
>     ExecStop=/usr/sbin/apachectl stop
>     ExecReload=/usr/sbin/apachectl graceful
>     PrivateTmp=true
>     Restart=on-abort
> 
>     [Install]
>     WantedBy=multi-user.target

what is your specific problem?

besdies there is no need for ExecStop at all and you can use type=simple
combined with "-D FOREGROUND"

EnvironmentFile=-/etc/sysconfig/httpd
Environment="PATH=/usr/bin:/usr/sbin"
Environment="LANG=C.UTF-8"
ExecStart=/usr/sbin/httpd $OPTIONS -D FOREGROUND
ExecReload=/usr/sbin/httpd $OPTIONS -k graceful

DUNNO what's about all that useless "deb-systemd-helper"



More information about the systemd-devel mailing list