[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#944796: apache2: systemd kill apache2.service on reload when apachectl gracful failed (configtest failed)



Source: apache2
Version: 2.4.38+deb10u3
Severity: important

Dear Maintainer,

when apachectl configtest failed, the systemd reload apache2.service command kill the apache mainprocess.

command:

 systemctl reload apache2.service

log:

 apachectl[6784]: AH00526: Syntax error on line 1 of /etc/apache2/apache2.conf:
 apachectl[6784]: Invalid command 'i', perhaps misspelled or defined by a module not included in the server configuration
 apachectl[6784]: Action 'graceful' failed.
 apachectl[6784]: The Apache error log may have more information.
 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
 systemd[1]: apache2.service: Failed with result 'exit-code'.
 systemd[1]: Reload failed for The Apache HTTP Server.

I think if the systemd service Type=Forking, when the main process exit with failure, the systemd stopping the whole cgrup.

ExecReload=/usr/sbin/apachectl graceful call the same apachectl script which is the ExecStart script also

Solution:

systemd service Type=Notify with mod_systemd like in RedHat & CentOS systems

Not too good solution: apacectl zero exit status on configtest failed (if the invoke from systemd)

regards:

Bertalan

-- System Information:
Debian Release: 9.11
  APT prefers oldstable
  APT policy: (500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-0.bpo.6-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Reply to: