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

« back to all changes in this revision

Viewing changes to debian/exim4-base.init

  • Committer: Bazaar Package Importer
  • Author(s): Marc Haber
  • Date: 2005-07-02 06:08:34 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050702060834-qk17pd52kb9nt3bj
Tags: 4.52-1
* new upstream version 4.51. (mh)
  * adapt 70_remove_exim-users_references
  * remove 37_gnutlsparams
  * adapt 36_pcre
  * adapt 31_eximmanpage
* fix package priorities to have them in sync with override again. (mh)
* Fix error in nb (Norwegian) translation.
  Thanks to Helge Hafting. (mh). Closes: #315775
* Standards-Version: 3.6.2, no changes needed. (mh)

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
set -e
10
10
 
11
 
[ -n "$EX4DEBUG" ] && set -x
 
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
12
23
 
13
24
upex4conf() {
14
25
  UPEX4CONF="update-exim4.conf"
17
28
  for p in $PATH; do
18
29
    if [ -x "$p/$UPEX4CONF" ]; then
19
30
      IFS="$OLDIFS"
20
 
      $p/$UPEX4CONF
 
31
      $p/$UPEX4CONF $UPEX4OPTS
21
32
      return 0
22
33
    fi
23
34
  done
38
49
##test -x $DAEMON || exit 0
39
50
test -x /usr/lib/exim4/exim4 || exit 0
40
51
 
41
 
#read default file
42
 
QUEUERUNNER='combined'
43
 
QUEUEINTERVAL='30m'
44
 
[ -f /etc/default/exim4 ] && . /etc/default/exim4
45
 
 
46
52
start_exim()
47
53
{
48
54
  case ${QUEUERUNNER} in
49
55
    combined)
50
 
      start-stop-daemon --start --pidfile /var/run/exim4/exim.pid \
 
56
      start-stop-daemon --start --pidfile "$PIDFILE" \
51
57
        --exec $DAEMON -- -bd -q${QFLAGS}${QUEUEINTERVAL} \
52
58
        ${COMMONOPTIONS} ${QUEUERUNNEROPTIONS} ${SMTPLISTENEROPTIONS}
53
59
      ;;
54
60
    separate)
55
 
      start-stop-daemon --start --pidfile /var/run/exim4/exim.pid \
 
61
      start-stop-daemon --start --pidfile "$PIDFILE" \
56
62
        --exec $DAEMON -- -bd ${SMTPLISTENEROPTIONS} ${COMMONOPTIONS}
57
 
      start-stop-daemon --start --pidfile /var/run/exim4/eximqr.pid \
58
 
        --exec $DAEMON -- -oP /var/run/exim4/eximqr.pid \
 
63
      start-stop-daemon --start --pidfile "$QRPIDFILE" \
 
64
        --exec $DAEMON -- -oP "$QRPIDFILE" \
59
65
        -q${QFLAGS}${QUEUEINTERVAL} ${QUEUERUNNEROPTIONS} ${COMMONOPTIONS}
60
66
      ;;
61
67
    queueonly)
62
 
      start-stop-daemon --start --pidfile /var/run/exim4/eximqr.pid \
63
 
        --exec $DAEMON -- -oP /var/run/exim4/eximqr.pid \
 
68
      start-stop-daemon --start --pidfile "$QRPIDFILE" \
 
69
        --exec $DAEMON -- -oP "$QRPIDFILE" \
64
70
        -q${QFLAGS}${QUEUEINTERVAL} ${QUEUERUNNEROPTIONS} ${COMMONOPTIONS}
65
71
      ;;
66
72
    no|ppp)
67
 
      start-stop-daemon --start --pidfile /var/run/exim4/exim.pid \
 
73
      start-stop-daemon --start --pidfile "$PIDFILE" \
68
74
        --exec $DAEMON -- -bd ${SMTPLISTENEROPTIONS}
69
75
      ;;
70
76
    nodaemon)
76
82
{
77
83
# we try to kill eximqr and exim SMTP listener, no matter what
78
84
# ${QUEUERUNNER} is set to, we could have switched since starting.
79
 
  [ -f /var/run/exim4/eximqr.pid ] && \
80
 
    start-stop-daemon --stop --pidfile /var/run/exim4/eximqr.pid \
81
 
      --oknodo --retry 30 --exec $DAEMON
82
 
  [ -f /var/run/exim4/exim.pid ] && \
83
 
    start-stop-daemon --stop --pidfile /var/run/exim4/exim.pid \
84
 
      --oknodo --retry 30 --exec $DAEMON
85
 
  rm -f /var/run/exim4/eximqr.pid /var/run/exim4/exim.pid 
 
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" 
86
92
}
87
93
 
88
94
reload_exim()
89
95
{
90
96
  case ${QUEUERUNNER} in
91
97
    combined|no|ppp)
92
 
      start-stop-daemon --stop --pidfile /var/run/exim4/exim.pid \
 
98
      start-stop-daemon --stop --pidfile "$PIDFILE" \
93
99
        --signal 1 --exec $DAEMON
94
100
      ;;
95
101
    separate)
96
 
      start-stop-daemon --stop --pidfile /var/run/exim4/exim.pid \
 
102
      start-stop-daemon --stop --pidfile "$PIDFILE" \
97
103
        --signal 1 --exec $DAEMON
98
 
      start-stop-daemon --stop --pidfile /var/run/exim4/eximqr.pid \
 
104
      start-stop-daemon --stop --pidfile "$QRPIDFILE" \
99
105
        --signal 1 --exec $DAEMON
100
106
      ;;
101
107
  esac  
102
108
}
103
 
 
 
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
}
104
119
 
105
120
# check for valid configuration file
106
121
isconfigvalid()
146
161
  status)
147
162
    exiwhat
148
163
    ;;
 
164
  force-stop)
 
165
    kill_all_exims $2
 
166
    ;;
149
167
  *)
150
168
    echo "Usage: $0 {start|stop|restart|reload|status}"
151
169
    exit 1