From owner-freebsd-questions@freebsd.org Thu Jan 25 17:56:51 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D93F9EC2FEF for ; Thu, 25 Jan 2018 17:56:51 +0000 (UTC) (envelope-from frank2@fjl.co.uk) Received: from bs1.fjl.org.uk (bs1.fjl.org.uk [84.45.41.196]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "bs1.fjl.org.uk", Issuer "bs1.fjl.org.uk" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7030669523 for ; Thu, 25 Jan 2018 17:56:51 +0000 (UTC) (envelope-from frank2@fjl.co.uk) Received: from roundcube.fjl.org.uk (localhost [127.0.0.1]) by bs1.fjl.org.uk (8.14.4/8.14.4) with ESMTP id w0PHumPG007935 for ; Thu, 25 Jan 2018 17:56:48 GMT (envelope-from frank2@fjl.co.uk) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 25 Jan 2018 17:56:48 +0000 From: Frank Leonhardt To: freebsd-questions@freebsd.org Subject: Re: Jails and Amavisd Organization: FJL Microsystems In-Reply-To: <1870a6827ca3544e6eb86a8fcb62b690.squirrel@webmail.harte-lyne.ca> References: <1870a6827ca3544e6eb86a8fcb62b690.squirrel@webmail.harte-lyne.ca> Message-ID: X-Sender: frank2@fjl.co.uk User-Agent: Roundcube Webmail/0.9.2 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jan 2018 17:56:52 -0000 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 > $myhostname > in amavisd.conf, or fix what uname(3) provides as a host's network > name! > > 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@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 > > # uname -n > hllmx150 > > 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 hllmx150.example.com 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 /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.