Source-Changes-HG archive

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

[src/trunk]: src/etc/rc.d use ${start_precmd} to check duplicate sendmail.cf.



details:   https://anonhg.NetBSD.org/src/rev/544afbcbfaa2
branches:  trunk
changeset: 487838:544afbcbfaa2
user:      itojun <itojun%NetBSD.org@localhost>
date:      Tue Jun 13 15:53:03 2000 +0000

description:
use ${start_precmd} to check duplicate sendmail.cf.
do not use "err" on failure, it is not that fatal (it's okay if we
don't start sendmail)

diffstat:

 etc/rc.d/sendmail |  26 +++++++++++++++-----------
 1 files changed, 15 insertions(+), 11 deletions(-)

diffs (42 lines):

diff -r 4cb9a4704e49 -r 544afbcbfaa2 etc/rc.d/sendmail
--- a/etc/rc.d/sendmail Tue Jun 13 15:48:56 2000 +0000
+++ b/etc/rc.d/sendmail Tue Jun 13 15:53:03 2000 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: sendmail,v 1.8 2000/06/04 08:33:58 itojun Exp $
+# $NetBSD: sendmail,v 1.9 2000/06/13 15:53:03 itojun Exp $
 #
 
 # PROVIDE: mail
@@ -16,16 +16,20 @@
 command="/usr/sbin/${name}"
 pidfile="/var/run/${name}.pid"
 required_files="/etc/mail/${name}.cf"
+start_precmd="sendmail_precmd"
+
+sendmail_precmd()
+{
+       # Die if there's pre-8.10 custom configuration file.  This check is
+       # mandatory for smooth upgrade.  See NetBSD PR 10100 for details.
+       #
+       if checkyesno sendmail && [ -f "/etc/${name}.cf" ]; then
+               if ! cmp -s "/etc/mail/${name}.cf" "/etc/${name}.cf"; then
+                       warn "${name} was not started, you have multiple sendmail.cf."
+                       return 1
+               fi
+       fi
+}
 
 load_rc_config $name
-
-# Die if there's pre-8.10 custom configuration file.  This check is mandatory
-# for smooth upgrade.  See NetBSD PR 10100 for details.
-#
-if checkyesno sendmail && [ -f "/etc/${name}.cf" ]; then
-       if ! cmp -s "/etc/mail/${name}.cf" "/etc/${name}.cf"; then
-               err 1 "${name} was not started, you have multiple sendmail.cf."
-       fi
-fi
-
 run_rc_command "$1"



Home | Main Index | Thread Index | Old Index