[Bug 271069] syslogd service inside client jail requires restart before server jail receives logs

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 08 Jun 2023 22:36:40 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271069

--- Comment #4 from Siva Mahadevan <me@svmhdvn.name> ---
Further information, I think this bug has to do with the order of operations
for:
* setting an IPv6 address for the jail
* starting the services enabled in /etc/rc.conf

I am testing a mail server jail and noticed this in the logs:


===== /var/log/fullsyslog.log =====
<19>1 2023-06-08T22:25:08.819854+00:00 mail.my.domain dovecot 10235 - - master:
Error: bind(::, 993) failed: Can't assign requested address
<19>1 2023-06-08T22:25:08.820010+00:00 mail.my.domain dovecot 10235 - - master:
Error: service(imap-login): listen(::, 993) failed: Can't assign requested
address
<18>1 2023-06-08T22:25:08.821619+00:00 mail.my.domain dovecot 10235 - - master:
Fatal: Failed to start listeners
<13>1 2023-06-08T22:25:08.827442+00:00 mail.my.domain siva 10239 - - /etc/rc:
WARNING: failed to start dovecot
<78>1 2023-06-08T22:25:08.836812+00:00 mail.my.domain /usr/sbin/cron 10243 - -
(CRON) WARNING (madvise() failed)
<35>1 2023-06-08T22:25:08.911037+00:00 mail.my.domain sshd 10260 - - error:
Bind to port 22 on :: failed: Can't assign requested address.
<34>1 2023-06-08T22:25:08.911360+00:00 mail.my.domain sshd 10260 - - fatal:
Cannot bind any address.
===================================

To me, it looks like the services are started *before* any IP address is
available in the jail to bind. I have only a single IPv6 address set in
/etc/jail.conf for each jail.

If I log into the jail with jexec after the jail is started, I notice the IPv6
address is available in `ifconfig`. Then, if I manually restart all enabled
services, everything works fine.

-- 
You are receiving this mail because:
You are the assignee for the bug.