Bug#933231: exim4-base: /etc/cron.daily/exim4-base can't detect hostname via hostname --fqdn

Andreas Metzler ametzler at bebt.de
Sun Jul 28 13:08:20 BST 2019


On 2019-07-27 Christian Garbs <mitch at cgarbs.de> wrote:
> Package: exim4-base
> Version: 4.92-8+deb10u1
> Severity: normal
> Tags: ipv6

> After the update from Stretch to Buster, on one of my systems
> /etc/cron.daily/exim4-base failed on every run with just

> hostname: Name or service not known

> as an error message.

> I could trace this to the usage of "hostname --fqdn" in the script.
> On this (and so far only on this) system this call simply fails:

> $ hostname --fqdn
> hostname: Name or service not known
[...]
> I don't yet know why, but I indeed have two hostnames:

> $ hostname --all-fqdns
> het.cgarbs.de het.cgarbs.de 

> I guess one is for the IPv4 connection and the other for IPv6.
[...]

Hello Christian,

on this system, hostname --fqdn succeeds but hostname --all-fqdns fails:
--
ametzler at argenau:~$ hostname --fqdn ; echo FQDN $? ; hostname --all-fqdns ; echo fqdnS $?
argenau.bebt.de
FQDN 0

fqdnS 0
--

In /etc/hosts I have got 127.0.0.1 as localhost and 127.0.1.1 as my
normal FQDN, which I think is not totally broken.

> Is there another way to get a proper hostname, perhaps from Exim
> or the Exim configuration, that can be used in /etc/cron.daily/exim4-base
> instead of calling "hostname --fqdn"?

There is
/usr/sbin/exim4 -bP primary_hostname
or
/usr/sbin/exim4 -be '${primary_hostname}'

How about the attached patch?

cu Andreas
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: better.hostname.diff
Type: text/x-diff
Size: 2286 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-exim4-maintainers/attachments/20190728/a13ea63e/attachment.diff>


More information about the Pkg-exim4-maintainers mailing list