1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00
freebsd/libexec
Mateusz Piotrowski d2e7bb630b rc.d/sendmail: Return non-zero if the daemon fails to start or is not running
If you have a mail server that is running sendmail daemon
(sendmail_enable=YES) and sendmail queue runner (sendmail_msp_queue=YES)
and the sendmail daemon dies, /etc/rc.d/sendmail status does see the
daemon is not running but returns 0 as the exit code.  This prevents
other programs (like puppet) from restarting sendmail to fix the issue.

Make sure that the exit code is propagated towards the end of the script
if any of the sendmail services fail.

This patch does not call exit directly but instead just sets the exit
status code by calling exit in a subshell. This way we do not exit the
current shell in case the service script is sourced (e.g., when
rc_fast_and_loose is active).

PR:		223132
MFC after:	2 weeks
Reported by:	pirzyk
Discussed with:	jilles, eugen
Reviewed by:	christos, gshapiro (previous version), markj
Approved by:	christos (mentor), markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D46862
Co-authored-by: Jim Pirzyk <pirzyk@FreeBSD.org>
2024-10-21 21:20:36 +02:00
..
atf Update Makefile.depend files 2024-10-14 10:26:17 -07:00
atrun Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
blacklistd-helper Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
bootpd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
comsat Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
dma Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
fingerd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
flua Fix the cross-build after recent commits 2024-09-30 00:08:49 -05:00
ftpd Remove "All Rights Reserved" from FreeBSD Foundation copyrights 2024-07-30 12:16:36 -04:00
getty Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
hyperv Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
kgdb crashinfo: Print stack traces for all on-CPU threads 2024-01-15 16:36:40 -05:00
mail.local Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
makewhatis.local Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
mknetid Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
nuageinit Update Makefile.depend files 2024-10-14 10:26:17 -07:00
phttpget Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
pppoed Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rbootd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rc rc.d/sendmail: Return non-zero if the daemon fails to start or is not running 2024-10-21 21:20:36 +02:00
revnetgroup Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc.rquotad Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc.rstatd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc.rusersd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc.rwalld Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rpc.sprayd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
rtld-elf Update Makefile.depend files 2024-10-14 10:26:17 -07:00
rtld-elf32 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
save-entropy Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
smrsh Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
talkd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
tcpd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
tests Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
tftp-proxy Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
tftpd Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ulog-helper Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ypxfr Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile nuageinit: add basic support for cloudinit. 2024-03-15 09:22:16 +01:00
Makefile.inc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00