Jails and Amavisd
frank2 at fjl.co.uk
Thu Jan 25 17:56:52 UTC 2018
On 2018-01-25 17:34, James B. Byrne via freebsd-questions wrote:
> We are trying to set up a remote MX service hosted in a FreeBSD-11
> (ez)jail. We have postfix running but we are having trouble with
> getting amavisd to start. Rnning it as a service gives this result:
> service amavisd start
> Starting amavisd.
> /usr/local/etc/rc.d/amavisd: WARNING: failed to start amavisd
> The log entry made in /var/log/messages says this:
> Jan 25 12:26:55 hllmx150 root: /usr/local/etc/rc.d/amavisd: WARNING:
> failed to start amavisd
> Which provides no clue as to what has gone wrong. There are no
> entries made in /var/log/amavis/amavisd.log respecting this failure.
> If we run amavisd from the command line then we see this:
> # amavisd
> The value of variable $myhostname is "hllmx150", but should have been
> a fully qualified domain name; perhaps uname(3) did not provide such.
> You must explicitly assign a FQDN of this host to variable
> in amavisd.conf, or fix what uname(3) provides as a host's network
> However, uname -a shows this:
> # uname -a
> FreeBSD hllmx150 11.1-RELEASE-p1 FreeBSD 11.1-RELEASE-p1 #0: Wed Aug
> 9 11:55:48 UTC 2017
> root at amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
> # uname -n
> So what is the error actually telling me?
I'd guess (knowing nothing specifically about amavisd) that you need to
set the hostname to a FQDN - i.e. so uname produces something like
I know nothing about ezjail - I've never found a need for it and it just
gets in the way. However, knowing the jail system pretty well, there are
two ways of setting the hostname. I assume ezjail writes the config
files for you.
The config file *should* be in /etc/jail.conf (although for backward
compatibility entries can be in rc.conf). Each jail definition should
have a like such as "host.hostname=hllmx150.example.com", although this
could be set globally with a macro such as
"host.hostname=$name.example.com", where $name expands to the jail name.
Unless you have something different in the local rc.conf, this is the
hostname amavisd will see. You can force it to something else in
<jail>/etc/rc.conf with a line like "hostname=hllmx150.example.com".
You can check it with something "jexec hllmx150 hostname". You can even
use "hostname" to set it temporarily.
More information about the freebsd-questions