tijl@ reports that service sendmail stop returns incorrect status code in the following setup: sendmail_enable="NO" sendmail_msp_queue_enable="YES" sendmail_outbound_enable="YES" sendmail_submit_enable="YES"
Created attachment 255060 [details] patch The problem is that the first run_rc_command call successfully stops sendmail and then the second call fails because it's no longer running. I believe this patch fixes the problem.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=6b17d944a1d448dbb797c5fa5b0778242ba02e52 commit 6b17d944a1d448dbb797c5fa5b0778242ba02e52 Author: Tijl Coosemans <tijl@FreeBSD.org> AuthorDate: 2024-12-03 10:45:10 +0000 Commit: Tijl Coosemans <tijl@FreeBSD.org> CommitDate: 2024-12-03 10:46:39 +0000 rc.d/sendmail: Fix error with some configurations The sendmail startup script can run 4 daemons: sendmail, sendmail_submit, sendmail_outbound, and sendmail_msp_queue. Of the first 3 at most one can be enabled. There's a run_rc_command call for each and the ones for sendmail and sendmail_msp_queue run unconditionally. For some rc commands this triggers warnings or errors when sendmail_enable="NO" or sendmail_msp_queue_enable="NO". Since d2e7bb630b83 these errors are propagated and the whole script fails. Fix this by first determining which daemons are enabled, setting ${name} and ${rcvar} accordingly, and then always calling run_rc_command conditionally. Also replace ${name}.cf with sendmail.cf because ${name} isn't always sendmail. PR: 282585 Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D47757 libexec/rc/rc.d/sendmail | 49 +++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=242eb8d4e0095f7d922ecec78b7a3c91a6e2d99c commit 242eb8d4e0095f7d922ecec78b7a3c91a6e2d99c Author: Tijl Coosemans <tijl@FreeBSD.org> AuthorDate: 2024-12-03 10:45:10 +0000 Commit: Tijl Coosemans <tijl@FreeBSD.org> CommitDate: 2024-12-31 13:17:46 +0000 rc.d/sendmail: Fix error with some configurations The sendmail startup script can run 4 daemons: sendmail, sendmail_submit, sendmail_outbound, and sendmail_msp_queue. Of the first 3 at most one can be enabled. There's a run_rc_command call for each and the ones for sendmail and sendmail_msp_queue run unconditionally. For some rc commands this triggers warnings or errors when sendmail_enable="NO" or sendmail_msp_queue_enable="NO". Since d2e7bb630b83 these errors are propagated and the whole script fails. Fix this by first determining which daemons are enabled, setting ${name} and ${rcvar} accordingly, and then always calling run_rc_command conditionally. Also replace ${name}.cf with sendmail.cf because ${name} isn't always sendmail. PR: 282585 Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D47757 (cherry picked from commit 6b17d944a1d448dbb797c5fa5b0778242ba02e52) libexec/rc/rc.d/sendmail | 49 +++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=fb3408bb6e5b7bebe8800d9f08579d9dc6236b81 commit fb3408bb6e5b7bebe8800d9f08579d9dc6236b81 Author: Tijl Coosemans <tijl@FreeBSD.org> AuthorDate: 2024-12-03 10:45:10 +0000 Commit: Tijl Coosemans <tijl@FreeBSD.org> CommitDate: 2024-12-31 13:16:10 +0000 rc.d/sendmail: Fix error with some configurations The sendmail startup script can run 4 daemons: sendmail, sendmail_submit, sendmail_outbound, and sendmail_msp_queue. Of the first 3 at most one can be enabled. There's a run_rc_command call for each and the ones for sendmail and sendmail_msp_queue run unconditionally. For some rc commands this triggers warnings or errors when sendmail_enable="NO" or sendmail_msp_queue_enable="NO". Since d2e7bb630b83 these errors are propagated and the whole script fails. Fix this by first determining which daemons are enabled, setting ${name} and ${rcvar} accordingly, and then always calling run_rc_command conditionally. Also replace ${name}.cf with sendmail.cf because ${name} isn't always sendmail. PR: 282585 Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D47757 (cherry picked from commit 6b17d944a1d448dbb797c5fa5b0778242ba02e52) libexec/rc/rc.d/sendmail | 49 +++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-)