Package: dnsmasq
Version: 2.77-2
Severity: normal

Dear Maintainer,

In Stretch and current testing, when postfix and resolvconf are
installed and the dnsmasq service is started after postfix by systemd,
it hangs (on the first start attempt after boot, subsequent attempts
appear to work).  To reproduce the issue on a fresh Stretch install:

# apt-get install dnsmasq postfix resolvconf
# systemctl disable dnsmasq
# reboot
# service dnsmasq start  (or systemctl start dnsmasq)

After about a minute the "service dnsmasq start" command prints:

Job for dnsmasq.service failed because a timeout was exceeded.
See "systemctl status dnsmasq.service" and "journalctl -xe" for details.

At the debug log level, the systemd log includes:

Aug 12 16:37:25 stretch systemd[2942]: dnsmasq.service: Executing: 
/etc/init.d/dnsmasq systemd-start-resolvconf
Aug 12 16:37:25 stretch systemd[1]: postfix.service: Trying to enqueue job 
postfix.service/reload/replace
Aug 12 16:37:25 stretch systemd[1]: postfix@-.service: Installed new job 
postfix@-.service/reload as 821
Aug 12 16:37:25 stretch systemd[1]: postfix.service: Installed new job 
postfix.service/reload as 820
Aug 12 16:37:25 stretch systemd[1]: postfix.service: Enqueued job 
postfix.service/reload as 820
Aug 12 16:37:30 stretch systemd[1]: Enabling showing of status.
Aug 12 16:38:55 stretch systemd[1]: dnsmasq.service: Start-post operation timed 
out. Stopping.

The issue appears to be that ExecStartPost of dnsmasq.service invokes
/etc/init.d/dnsmasq systemd-start-resolvconf which invokes resolvconf
which invokes /etc/resolvconf/update-libc.d/postfix which invokes
"/usr/sbin/service postfix reload" which hangs because the postfix
reload operation is queued behind the currently executing dnsmasq start
operation, causing the dnsmasq start operation to eventually time out.

I have been unable to determine why the hang only happens on the first
dnsmasq start attempt after boot.  I can confirm "service postfix
reload" is called, but it does not hang on subsequent attempts.

This could be a bug in systemd, but since it manifested in dnsmasq, I
have filed the issue here to start.  Please reassign if you think it is
a systemd issue.

Thanks,
Kevin

-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (101, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.12.0-kevinoid1 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8), 
LANGUAGE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages dnsmasq depends on:
ii  dnsmasq-base         2.77-2
ii  init-system-helpers  1.49
ii  lsb-base             9.20161125
ii  netbase              5.4

dnsmasq recommends no packages.

Versions of packages dnsmasq suggests:
ii  resolvconf  1.79

-- Configuration Files:
/etc/dnsmasq.conf changed [not included]

-- no debconf information

Reply via email to