[Unit]
Description=CFEngine Enterprise Webserver
After=syslog.target
{{#classes.mission_portal_http2_enabled}}
Wants=cf-php-fpm.service
After=cf-php-fpm.service
{{/classes.mission_portal_http2_enabled}}
{{^classes.mission_portal_http2_enabled}}
Wants=cf-postgres.service
After=cf-postgres.service
{{/classes.mission_portal_http2_enabled}}
ConditionPathExists={{{vars.sys.workdir}}}/httpd/bin/apachectl
PartOf=cfengine3.service

[Service]
Type=forking
ExecStart={{{vars.sys.workdir}}}/httpd/bin/apachectl start
ExecStop={{{vars.sys.workdir}}}/httpd/bin/apachectl stop
ExecReload={{{vars.sys.workdir}}}/httpd/bin/apachectl graceful
PIDFile={{{vars.sys.workdir}}}/httpd/httpd.pid
Restart=always
RestartSec=10
UMask=0177

[Install]
WantedBy=multi-user.target
