From 93227805ffb60f86a1f6149a38fbb193faca8004 Mon Sep 17 00:00:00 2001 From: Gregory Neil Shapiro Date: Sun, 19 Oct 2003 00:31:50 +0000 Subject: Before trying to restart/stop the MTA or MSP queue runner, make sure we are configured to use an MTA or MSP queue runner. Otherwise the script used to complain about the missing PID file. PR: conf/57075 Submitted by: Jonathan Chen MFC after: 2 weeks --- etc/rc.sendmail | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) (limited to 'etc') diff --git a/etc/rc.sendmail b/etc/rc.sendmail index 74dde31883db..b025bc0bd62c 100644 --- a/etc/rc.sendmail +++ b/etc/rc.sendmail @@ -84,6 +84,30 @@ start_mta() stop_mta() { + # Check to make sure we are configured to start an MTA + case ${sendmail_enable} in + [Nn][Oo][Nn][Ee]) + return + ;; + [Yy][Ee][Ss]) + ;; + *) + case ${sendmail_submit_enable} in + [Yy][Ee][Ss]) + ;; + *) + case ${sendmail_outbound_enable} in + [Yy][Ee][Ss]) + ;; + *) + return + ;; + esac + ;; + esac + ;; + esac + if [ -r ${sendmail_pidfile} ]; then echo -n ' sendmail' kill -TERM `head -1 ${sendmail_pidfile}` @@ -94,6 +118,29 @@ stop_mta() restart_mta() { + # Check to make sure we are configured to start an MTA + case ${sendmail_enable} in + [Nn][Oo][Nn][Ee]) + return + ;; + [Yy][Ee][Ss]) + ;; + *) + case ${sendmail_submit_enable} in + [Yy][Ee][Ss]) + ;; + *) + case ${sendmail_outbound_enable} in + [Yy][Ee][Ss]) + ;; + *) + return + ;; + esac + ;; + esac + ;; + esac if [ -r ${sendmail_pidfile} ]; then echo -n ' sendmail' kill -HUP `head -1 ${sendmail_pidfile}` @@ -122,6 +169,24 @@ start_mspq() stop_mspq() { + # Check to make sure we are configured to start an MSP queue runner + case ${sendmail_enable} in + [Nn][Oo][Nn][Ee]) + return + ;; + *) + if [ -r /etc/mail/submit.cf ]; then + case ${sendmail_msp_queue_enable} in + [Yy][Ee][Ss]) + ;; + *) + return + ;; + esac + fi + ;; + esac + if [ -r ${sendmail_mspq_pidfile} ]; then echo -n ' sendmail-clientmqueue' kill -TERM `head -1 ${sendmail_mspq_pidfile}` @@ -132,6 +197,24 @@ stop_mspq() restart_mspq() { + # Check to make sure we are configured to start an MSP queue runner + case ${sendmail_enable} in + [Nn][Oo][Nn][Ee]) + return + ;; + *) + if [ -r /etc/mail/submit.cf ]; then + case ${sendmail_msp_queue_enable} in + [Yy][Ee][Ss]) + ;; + *) + return + ;; + esac + fi + ;; + esac + if [ -r ${sendmail_mspq_pidfile} ]; then echo -n ' sendmail-clientmqueue' kill -HUP `head -1 ${sendmail_mspq_pidfile}` -- cgit v1.2.3