Getting rid of 2*Njail sendmail processes
Poul-Henning Kamp
phk at phk.freebsd.dk
Mon Nov 16 22:12:58 UTC 2015
It has always bothered me to no end, to have to run two sendmail
processes in jails, just to be able to get the cron emails.
Tonight I figured out how to avoid that:
In the hosts rc.conf:
sendmail_enable=YES
That makes sendmail listen to *:25
In the jails rc.conf:
sendmail_enable=NONE
Add the magic sauce:
Put all jail hostnames into the hosts /etc/mail/local-host-names
The quick way:
jls | awk '{print $3}' > /etc/mail/local-host-names
That makes the hosts sendmail treat all the jails as itself.
Clean up, from the host:
killall sendmail
sh /etc/rc.d/sendmail start
Congratulations: You just got rid of 2*Njail sendmail processes.
Obviously this doesn't allow you to receive email in the jails, so
it is not a general solution for all jails, but only for the very
common case where the only email activity is out of the jails.
Poul-Henning
PS: Somebody please stick this in the relevant handbooks/docs...
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
More information about the freebsd-hackers
mailing list