Debian Codegraph @

debian/qpsmtpd-start

raw
1 #!/bin/sh
2 #
3 # Starts qpsmtpd for qpsmtpd.service from the debconf settings that
4 # /etc/init.d/qpsmtpd used. ExecStart cannot do it alone, as SERVER
5 # picks the binary and INTERFACES expands to one --listen-address each
6 #
7 # --detach and --pid-file are dropped, as systemd follows the process
8
9 set -e
10
11 PORT="25"
12 RUNAS="qpsmtpd"
13 INTERFACES=""
14 SERVER="forkserver"
15 EXTRA_ARGS=""
16
17 [ -f "/etc/qpsmtpd/debconf-settings" ] && . "/etc/qpsmtpd/debconf-settings"
18
19 [ -x "/usr/bin/qpsmtpd-$SERVER" ] || {
20 echo "qpsmtpd: /usr/bin/qpsmtpd-$SERVER is not executable" >&2
21 exit 1
22 }
23
24 QPSMTPD_CONFIG="/etc/qpsmtpd"
25 export QPSMTPD_CONFIG
26
27 LISTEN=""
28 for addr in $INTERFACES ; do
29 LISTEN="$LISTEN --listen-address $addr"
30 done
31
32 exec "/usr/bin/qpsmtpd-$SERVER" \
33 --port "$PORT" \
34 --user "$RUNAS" \
35 $LISTEN $EXTRA_ARGS