~ubuntu-branches/ubuntu/hardy/exim4/hardy-proposed

« back to all changes in this revision

Viewing changes to debian/exim4-base.exim4.init

  • Committer: Bazaar Package Importer
  • Author(s): Marc Haber
  • Date: 2006-01-12 12:36:50 UTC
  • Revision ID: james.westby@ubuntu.com-20060112123650-6p1i52zkfiyd7ioy
Tags: 4.60-2
* Add, but not enable, 37_dns_disable_additional_section.dpatch,
  which might be a possible fix for #342619
* conf.d/auth/30_exim4-config_examples: add hint to adapt public_name
  string in support_broken_outlook_express_4_server authenticator if
  other authencators than LOGIN and PLAIN are offered.
* Fix missing special characters in some debconf translations.
  Thanks to Davide Viti. (mh) Closes: #341442
* Fix broken README reference in system_aliases router docs. (mh)
* remove references to alias files from the address_pipe transport. (mh)
* remove "Some-State" default from exim-gencert. (mh)
* Clarify split vs unsplit config in README.Debian. Thanks to Faheem
  Mitha and Ross Boylan for helping. (mh)
* Update Build-Depends to libmysqlclient15-dev. (mh) Closes: #343767
* Fix wrong header in conf.d/routers/300_exim4-config_real_local.
  Thanks to Ross Boylan for spotting this. (mh)
* Document headers_rewrite, return_path and dc_mailname_in_oh in
  update-exim4.conf man page. (mh) Closes: #332520, #342233
* Re-Instate debian/patches/31_eximmanpage which was erroneously
  removed in 4.60-1, we have local Debian patches in here. Thanks to
  Ross Boylan for spotting this. (mh) Closes: #330967
* Mention relay permission from localhost in update-exim4.conf(8). (mh)
* Add more prose to relay control configuration. (mh)
* Update Greek debconf translation (Thanks, Kostas Papadimas) (am)
  Closes: #344576
* Add cross-reference to README.Debian to better find macro docs.
  Thanks to Shyamal Prasad. (mh) Closes: #329988
* Fix incorrect variable substitution in pt_BR debconf translation. (Thanks,
  Felipe Augusto van de Wiel) (am) Closes: #345363
* [exim4-config.templates, po/*po] Replace reference to README.SMTP-AUTH
  with one to its replacement README.Debian.html. (am) Closes: #344826
* Re-work long package descriptions. Move reference to README.Debian in
  front, add hint to dpkg-reconfigure exim4-config, complete stub
  sentences, remove non-referenced acronym MTA from the long
  descriptions, move explanation what exim is to the very front.
* README.Debian: Add section about changing the configuration,
  explain structure of conf.d and .conf.template, add hint that the SMTP
  AUTH examples are documented.
* Introduce MAIN_TLS_CERTKEY to allow for single-file certificate/key
  storage. Thanks to John Goerzen. (mh) Closes: #315126
* Mention entropy issue in README.Debian.
* Ship symlink to /usr/sbin/exim, see NEWS.Debian. (mh) Closes: 319316
* use dh_installinit -n instead of --noscripts to work around #347577. (mh)
* use dh_installinit --name instead of --init-script, rename init
  script. (mh)
* move man pages from daemon packages to exim4-base, add lintian
  and linda overrides to allow daemon packages not to contain man pages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
# /etc/init.d/exim4
 
3
#
 
4
# Written by Miquel van Smoorenburg <miquels@drinkel.ow.org>.
 
5
# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
 
6
# Modified for exim by Tim Cutts <timc@chiark.greenend.org.uk>
 
7
# Modified for exim4 by Andreas Metzler <ametzler@downhill.at.eu.org>
 
8
 
 
9
set -e
 
10
 
 
11
if [ -n "$EX4DEBUG" ]; then
 
12
  echo "now debugging $0 $@"
 
13
  set -x
 
14
fi
 
15
 
 
16
#read default file
 
17
QUEUERUNNER='combined'
 
18
QUEUEINTERVAL='30m'
 
19
UPEX4OPTS=''
 
20
PIDFILE="/var/run/exim4/exim.pid"
 
21
QRPIDFILE="/var/run/exim4/eximqr.pid"
 
22
[ -f /etc/default/exim4 ] && . /etc/default/exim4
 
23
 
 
24
upex4conf() {
 
25
  UPEX4CONF="update-exim4.conf"
 
26
  OLDIFS="$IFS"
 
27
  IFS=:
 
28
  for p in $PATH; do
 
29
    if [ -x "$p/$UPEX4CONF" ]; then
 
30
      IFS="$OLDIFS"
 
31
      $p/$UPEX4CONF $UPEX4OPTS
 
32
      return 0
 
33
    fi
 
34
  done
 
35
  IFS="$OLDIFS"
 
36
}
 
37
 
 
38
# Exit if exim runs from /etc/inetd.conf
 
39
if [ -f /etc/inetd.conf ] && grep -E -q "^ *([0-9.]+:)?smtp" /etc/inetd.conf
 
40
then
 
41
  upex4conf
 
42
  exit 0
 
43
fi
 
44
 
 
45
 
 
46
DAEMON=/usr/sbin/exim4
 
47
NAME=exim4
 
48
 
 
49
##test -x $DAEMON || exit 0
 
50
test -x /usr/lib/exim4/exim4 || exit 0
 
51
 
 
52
start_exim()
 
53
{
 
54
  case ${QUEUERUNNER} in
 
55
    combined)
 
56
      start-stop-daemon --start --pidfile "$PIDFILE" \
 
57
        --exec $DAEMON -- -bd -q${QFLAGS}${QUEUEINTERVAL} \
 
58
        ${COMMONOPTIONS} ${QUEUERUNNEROPTIONS} ${SMTPLISTENEROPTIONS}
 
59
      ;;
 
60
    separate)
 
61
      start-stop-daemon --start --pidfile "$PIDFILE" \
 
62
        --exec $DAEMON -- -bd ${SMTPLISTENEROPTIONS} ${COMMONOPTIONS}
 
63
      start-stop-daemon --start --pidfile "$QRPIDFILE" \
 
64
        --exec $DAEMON -- -oP "$QRPIDFILE" \
 
65
        -q${QFLAGS}${QUEUEINTERVAL} ${QUEUERUNNEROPTIONS} ${COMMONOPTIONS}
 
66
      ;;
 
67
    queueonly)
 
68
      start-stop-daemon --start --pidfile "$QRPIDFILE" \
 
69
        --exec $DAEMON -- -oP "$QRPIDFILE" \
 
70
        -q${QFLAGS}${QUEUEINTERVAL} ${QUEUERUNNEROPTIONS} ${COMMONOPTIONS}
 
71
      ;;
 
72
    no|ppp)
 
73
      start-stop-daemon --start --pidfile "$PIDFILE" \
 
74
        --exec $DAEMON -- -bd ${SMTPLISTENEROPTIONS}
 
75
      ;;
 
76
    nodaemon)
 
77
      ;;    
 
78
  esac
 
79
}
 
80
 
 
81
stop_exim()
 
82
{
 
83
# we try to kill eximqr and exim SMTP listener, no matter what
 
84
# ${QUEUERUNNER} is set to, we could have switched since starting.
 
85
  [ -f "$QRPIDFILE" ] && \
 
86
    start-stop-daemon --stop --pidfile "$QRPIDFILE" \
 
87
      --oknodo --retry 30 --exec $DAEMON
 
88
  [ -f "$PIDFILE" ] && \
 
89
    start-stop-daemon --stop --pidfile "$PIDFILE" \
 
90
      --oknodo --retry 30 --exec $DAEMON
 
91
  rm -f "$QRPIDFILE" "$PIDFILE" 
 
92
}
 
93
 
 
94
reload_exim()
 
95
{
 
96
  case ${QUEUERUNNER} in
 
97
    combined|no|ppp)
 
98
      start-stop-daemon --stop --pidfile "$PIDFILE" \
 
99
        --signal 1 --exec $DAEMON
 
100
      ;;
 
101
    separate)
 
102
      start-stop-daemon --stop --pidfile "$PIDFILE" \
 
103
        --signal 1 --exec $DAEMON
 
104
      start-stop-daemon --stop --pidfile "$QRPIDFILE" \
 
105
        --signal 1 --exec $DAEMON
 
106
      ;;
 
107
  esac  
 
108
}
 
109
 
 
110
kill_all_exims()
 
111
{
 
112
  SIG="${1:-TERM}"
 
113
  for pid in $(pidof $NAME); do
 
114
    if [ "$(readlink /proc/$pid/root)" = "/" ]; then
 
115
      kill -$SIG $pid
 
116
    fi
 
117
  done
 
118
}
 
119
 
 
120
# check for valid configuration file
 
121
isconfigvalid()
 
122
{
 
123
if ! $DAEMON -bV > /dev/null ; then
 
124
  echo
 
125
  echo "Warning! Invalid configuration file for $NAME. Exiting." 1>&2
 
126
  exit 1
 
127
fi
 
128
}
 
129
 
 
130
case "$1" in
 
131
  start)
 
132
    echo -n "Starting MTA: "
 
133
    # regenerate exim4.conf
 
134
    upex4conf
 
135
    isconfigvalid
 
136
    start_exim
 
137
    echo "$NAME."
 
138
    ;;
 
139
  stop)
 
140
    echo -n "Stopping MTA: "
 
141
    stop_exim
 
142
    echo "$NAME."
 
143
      ;;
 
144
  restart)
 
145
    echo -n "Restarting MTA: "
 
146
    # regenerate exim4.conf
 
147
    upex4conf
 
148
    isconfigvalid
 
149
    stop_exim
 
150
    sleep 2
 
151
    start_exim
 
152
    echo "$NAME."
 
153
    ;;
 
154
  reload|force-reload)
 
155
    echo "Reloading $NAME configuration files"
 
156
    # regenerate exim4.conf
 
157
    upex4conf
 
158
    isconfigvalid
 
159
    reload_exim
 
160
    ;;
 
161
  status)
 
162
    exiwhat
 
163
    ;;
 
164
  force-stop)
 
165
    kill_all_exims $2
 
166
    ;;
 
167
  *)
 
168
    echo "Usage: $0 {start|stop|restart|reload|status}"
 
169
    exit 1
 
170
    ;;
 
171
esac
 
172
 
 
173
exit 0
 
174
# vim:tabstop=2:expandtab:shiftwidth=2