sendmail (78345) | sendmail (98184) |
---|---|
1#!/bin/sh 2# | 1#!/bin/sh 2# |
3# $NetBSD: sendmail,v 1.12 2000/10/09 06:11:38 nisimura Exp $ | 3# $NetBSD: sendmail,v 1.14 2002/02/12 01:26:36 lukem Exp $ 4# $FreeBSD: head/etc/rc.d/sendmail 98184 2002-06-13 22:14:37Z gordon $ |
4# 5 6# PROVIDE: mail 7# REQUIRE: LOGIN | 5# 6 7# PROVIDE: mail 8# REQUIRE: LOGIN |
9# KEYWORD: FreeBSD NetBSD 10# we make mail start late, so that things like .forward's are not 11# processed until the system is fully operational |
|
8 | 12 |
9# we could do this, but make mail start late, so that things like 10# .forward's are not processed until the system is fully operational 11## REQUIRE: DAEMON 12 | 13# XXX - Get together with sendmail mantainer to figure out how to 14# better handle SENDMAIL_ENABLE and 3rd party MTAs. 15# |
13. /etc/rc.subr 14 15name="sendmail" | 16. /etc/rc.subr 17 18name="sendmail" |
16rcvar=$name | 19rcvar=`set_rcvar` |
17command="/usr/sbin/${name}" 18pidfile="/var/run/${name}.pid" 19required_files="/etc/mail/${name}.cf" 20start_precmd="sendmail_precmd" 21 22sendmail_precmd() 23{ 24 # Die if there's pre-8.10 custom configuration file. This check is 25 # mandatory for smooth upgrade. See NetBSD PR 10100 for details. 26 # | 20command="/usr/sbin/${name}" 21pidfile="/var/run/${name}.pid" 22required_files="/etc/mail/${name}.cf" 23start_precmd="sendmail_precmd" 24 25sendmail_precmd() 26{ 27 # Die if there's pre-8.10 custom configuration file. This check is 28 # mandatory for smooth upgrade. See NetBSD PR 10100 for details. 29 # |
27 if checkyesno sendmail && [ -f "/etc/${name}.cf" ]; then | 30 if checkyesno ${rcvar} && [ -f "/etc/${name}.cf" ]; then |
28 if ! cmp -s "/etc/mail/${name}.cf" "/etc/${name}.cf"; then 29 warn \ 30 "${name} was not started; you have multiple copies of sendmail.cf." 31 return 1 32 fi 33 fi 34 35 # check modifications on /etc/mail/aliases --- 6 unchanged lines hidden (view full) --- 42 else 43 echo \ 44 "${name}: /etc/mail/aliases.db not present, generating" 45 /usr/bin/newaliases 46 fi 47 48 # check couple of common db files, too 49 for f in genericstable virtusertable domaintable mailertable; do | 31 if ! cmp -s "/etc/mail/${name}.cf" "/etc/${name}.cf"; then 32 warn \ 33 "${name} was not started; you have multiple copies of sendmail.cf." 34 return 1 35 fi 36 fi 37 38 # check modifications on /etc/mail/aliases --- 6 unchanged lines hidden (view full) --- 45 else 46 echo \ 47 "${name}: /etc/mail/aliases.db not present, generating" 48 /usr/bin/newaliases 49 fi 50 51 # check couple of common db files, too 52 for f in genericstable virtusertable domaintable mailertable; do |
50 if [ -r "/etc/mail/$f" ] && [ "/etc/mail/$f" -nt "/etc/mail/$f.db" ]; 51 then | 53 if [ -r "/etc/mail/$f" -a \ 54 "/etc/mail/$f" -nt "/etc/mail/$f.db" ]; then |
52 echo \ 53 "${name}: /etc/mail/$f newer than /etc/mail/$f.db, regenerating" 54 /usr/sbin/makemap hash /etc/mail/$f < /etc/mail/$f 55 fi 56 done 57} 58 59load_rc_config $name 60run_rc_command "$1" | 55 echo \ 56 "${name}: /etc/mail/$f newer than /etc/mail/$f.db, regenerating" 57 /usr/sbin/makemap hash /etc/mail/$f < /etc/mail/$f 58 fi 59 done 60} 61 62load_rc_config $name 63run_rc_command "$1" |
64 65case `${CMD_OSTYPE}` in 66FreeBSD) 67 case $SENDMAIL_ENABLE in 68 NONE) 69 exit 70 ;; 71 esac 72 pid_file= 73 required_files= 74 start_precmd= 75 76 name="sendmail_outbound" 77 rcvar=`set_rcvar` 78 start_cmd="/usr/sbin/sendmail $sendmail_outbound_flags" 79 #command="/usr/sbin/sendmail" 80 81 load_rc_config $name 82 run_rc_command "$1" 83 84 name="sendmail_submit" 85 rcvar=`set_rcvar` 86 start_cmd="/usr/sbin/sendmail $sendmail_submit_flags" 87 #command="/usr/sbin/sendmail" 88 89 load_rc_config $name 90 run_rc_command "$1" 91 92 name="sendmail_clientmqueue" 93 rcvar="sendmail_msp_queue_enable" 94 start_cmd="/usr/sbin/sendmail $sendmail_msp_queue_flags" 95 #command="/usr/sbin/sendmail" 96 #command_args="${sendmail_msp_queue_flags}" 97 required_files="/etc/mail/submit.cf" 98 99 load_rc_config $name 100 run_rc_command "$1" 101 ;; 102esac |
|