Re: How To Set Up Mail-out-only System ?
On Wed, Feb 11, 2004 at 01:41:13AM +0000, Nick Boyce wrote:
[want a send-only exim]
> The default Exim MTA is installed, and I've commented out the SMTP line
> from inetd.conf, but there is a /etc/init.d/exim startup script that
> comes with the Exim package, that has this :
> # Exit if exim runs from /etc/inetd.conf
> if [ -f /etc/inetd.conf ] && grep -q "^ *smtp" /etc/inetd.conf; then
> exit 0
> fi
> [...]
> case "$1" in
> start)
> echo -n "Starting MTA: "
> start-stop-daemon --start --pidfile /var/run/exim/exim.pid \
> --exec $DAEMON -- -bd -q30m
If you remove the '-bd', exim will run as a daemon, but it will only
send mail out (processing its queue). It won't bind tcp/25 to receive
mail.
(Exim will use a different pid file, so the init script has to be
modified for that, too. I've attached one with the necessary
modifications.)
> Should I just remove the S20exim symlink from rc?.d ?
If you don't want exim to run as a daemon at all, then you should rename
those links to K20exim. The crontab fragment in /etc/cron.d/exim will do
a queue run four times an hour.
> That seems a bit of a kludge. If this was NetBSD, I'd set something
> like "exim=no" in somewhere like rc.conf ... is there a Debian
> equivalent to that ?
If you don't want to drive it the System V-ish way, you could probably
do something like that:
add to exim init script:
| . /etc/default/exim
| if [ "$SHOULDIRUN = "no" ]; then
| exit 0;
| fi
then create /etc/default/exim and add:
| SHOULDIRUN=no
--
William Aoki KD7YAF waoki@umnh.utah.edu /"\ ASCII Ribbon Campaign
\ / No HTML in mail or news!
X
/ \
#! /bin/sh
# /etc/init.d/exim
#
# Written by Miquel van Smoorenburg <miquels@drinkel.ow.org>.
# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Modified for exim by Tim Cutts <timc@chiark.greenend.org.uk>
set -e
# Exit if exim runs from /etc/inetd.conf
if [ -f /etc/inetd.conf ] && grep -q "^ *smtp" /etc/inetd.conf; then
exit 0
fi
DAEMON=/usr/sbin/exim
NAME=exim
test -x $DAEMON || exit 0
case "$1" in
start)
echo -n "Starting MTA: "
start-stop-daemon --start --pidfile /var/run/exim/exim.pid-q30m \
--exec $DAEMON -- -q30m
echo "exim."
;;
stop)
echo -n "Stopping MTA: "
start-stop-daemon --stop --pidfile /var/run/exim/exim.pid-q30m \
--oknodo --retry 30 --exec $DAEMON
echo "exim."
;;
restart)
echo -n "Restarting MTA: "
start-stop-daemon --stop --pidfile /var/run/exim/exim.pid-q30m \
--oknodo --retry 30 --exec $DAEMON
start-stop-daemon --start --pidfile /var/run/exim/exim.pid-q30m \
--exec $DAEMON -- -q30m
echo "exim."
;;
reload|force-reload)
echo "Reloading $NAME configuration files"
start-stop-daemon --stop --pidfile /var/run/exim/exim.pid-q30m \
--signal 1 --exec $DAEMON
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload}"
exit 1
;;
esac
exit 0
Reply to: