HomeFreeBSD

rc.d/sendmail: Fix error with some configurations

Description

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)

Details

Provenance
tijlAuthored on Dec 3 2024, 10:45 AM
Reviewer
markj
Differential Revision
D47757: rc.d/sendmail: Fix error with some configurations
Parents
rG7700d456bff4: linprocfs: Properly reset error variable for mtab generation
Branches
Unknown
Tags
Unknown