Print this page
5166 sendmail package should be replaceable
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/svc/shell/sendmail_include.sh
+++ new/usr/src/cmd/svc/shell/sendmail_include.sh
1 1 #!/sbin/sh
2 2 #
3 3 # CDDL HEADER START
4 4 #
5 5 # The contents of this file are subject to the terms of the
6 6 # Common Development and Distribution License (the "License").
7 7 # You may not use this file except in compliance with the License.
8 8 #
9 9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 # or http://www.opensolaris.org/os/licensing.
11 11 # See the License for the specific language governing permissions
12 12 # and limitations under the License.
13 13 #
14 14 # When distributing Covered Code, include this CDDL HEADER in each
15 15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
16 16 # If applicable, add the following below this CDDL HEADER, with the
17 17 # fields enclosed by brackets "[]" replaced with your own identifying
18 18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 19 #
20 20 # CDDL HEADER END
21 21 #
22 22 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 23 # Use is subject to license terms.
24 24
25 25 DEFAULT_FILE="/etc/default/sendmail"
26 -SENDMAIL="/usr/lib/sendmail"
26 +SENDMAIL="/usr/lib/smtp/sendmail/sendmail"
27 27 PATH="/usr/bin:/usr/sbin:/usr/ccs/bin"
28 28 export PATH
29 29
30 30 check_queue_interval_syntax()
31 31 {
32 32 default="15m"
33 33 if [ $# -lt 1 ]; then
34 34 answer=$default
35 35 return
36 36 fi
37 37 if echo $1 | egrep '^([0-9]*[1-9][0-9]*[smhdw])+$' >/dev/null 2>&1; then
38 38 answer=$1
39 39 else
40 40 answer=$default
41 41 fi
42 42 }
43 43
44 44 check_and_kill()
45 45 {
46 46 PID=`head -1 $1`
47 47 kill -0 $PID > /dev/null 2>&1
48 48 [ $? -eq 0 ] && kill $PID
49 49 }
50 50
51 51 exist_or_exit()
52 52 {
53 53 if [ ! -f $1 ]; then
54 54 echo "$1 does not exist" >&2
55 55 exit $SMF_EXIT_ERR_CONFIG
56 56 fi
57 57 }
58 58
59 59 turn_m4_crank()
60 60 {
61 61 # expected to be called with two arguments: .cf path & path to m4 file
62 62 [ $# -lt 2 ] && return
63 63 cf_path=$1
64 64 m4_path=$2
65 65 if [ "$m4_path" = "_DONT_TOUCH_THIS" ]; then
66 66 if [ -f "${cf_path}.old" ]; then
67 67 mv "$cf_path" "${cf_path}.new"
68 68 [ $? -ne 0 ] && exit $SMF_EXIT_ERR_CONFIG
69 69 mv "${cf_path}.old" "$cf_path"
70 70 [ $? -ne 0 ] && exit $SMF_EXIT_ERR_CONFIG
71 71 fi
72 72 #
73 73 # If ${cf_path}.old does not exist, assume it was taken care
74 74 # of on a previous run.
75 75 #
76 76 else
77 77 case "$m4_path" in
78 78 /*) ;; # absolute path
79 79 *) return;;
80 80 esac
81 81 exist_or_exit "$m4_path"
82 82 cd `dirname "$m4_path"`
83 83 base=`basename "$m4_path"`
84 84 name=`basename "$m4_path" .mc`
85 85 info=`svcprop -p config/include_info $SMF_FMRI 2>/dev/null`
86 86 if [ "$info" = "true" ]; then
87 87 m4flags=""
88 88 else
89 89 m4flags="-DSUN_HIDE_INTERNAL_DETAILS"
90 90 fi
91 91 m4 $m4flags /etc/mail/cf/m4/cf.m4 "$base" > "${name}.cf"
92 92 [ $? -ne 0 ] && exit $SMF_EXIT_ERR_CONFIG
93 93 cmp -s "${name}.cf" "$cf_path" || (
94 94 cp "${name}.cf" "${cf_path}.tmp" &&
95 95 chown root:bin "${cf_path}.tmp" &&
96 96 chmod 444 "${cf_path}.tmp" &&
97 97 mv "${cf_path}.tmp" "$cf_path"
98 98 )
99 99 [ $? -ne 0 ] && exit $SMF_EXIT_ERR_CONFIG
100 100 fi
101 101 }
↓ open down ↓ |
65 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX