You are not logged in.

#1 2014-08-17 23:10:58

herOldMan
Member
Registered: 2013-10-11
Posts: 151

Occasional stop job hang for avahi at shutdown

Periodically (~5%) I have a hang at shutdown:

A stop job is running for Avahi mDNS/DNS-SD stack

It will eventually shutdown (after the 90 sec timeout).



My problem is identical to unsolved post at https://bbs.archlinux.org/viewtopic.php?id=165344

Because it is intermittent, I have not been able to pinpoint the problem's source. A debug shell provides nothing interesting.

How best to determine the cause?

Offline

#2 2014-08-18 02:05:23

Pse
Member
Registered: 2008-03-15
Posts: 413

Re: Occasional stop job hang for avahi at shutdown

Hmm, odd, did you mount or connect to any service exposed through Avahi? I take it the problem goes away entirely if you disable Avahi, right?

Offline

#3 2014-08-18 13:39:06

herOldMan
Member
Registered: 2013-10-11
Posts: 151

Re: Occasional stop job hang for avahi at shutdown

Yes,

systemctl list-unit-files
.....
avahi-daemon.service                       disabled

but it seems to run anyway.

sudo systemctl stop avahi-daemon
Warning: Stopping avahi-daemon.service, but it can still be activated by:
  avahi-daemon.socket

I'll try disabling avahi-socket and watch for the hang for a while.

Offline

#4 2014-08-19 01:02:39

herOldMan
Member
Registered: 2013-10-11
Posts: 151

Re: Occasional stop job hang for avahi at shutdown

Disabling avahi-socket did not work. I still have an intermitant stop failure. Here are the last few lines from the journal:

Aug 18 20:36:30 arch cupsd[494]: cupsd: client.c:626: avahi_client_free: Assertion `client' failed.
Aug 18 20:36:30 arch systemd[1]: cups.service: main process exited, code=killed, status=6/ABRT
Aug 18 20:36:30 arch systemd[1]: Unit cups.service entered failed state.
Aug 18 20:36:30 arch mkinitcpio[3019]: ==> Build complete.
Aug 18 20:38:00 arch systemd[1]: avahi-daemon.service stop-sigterm timed out. Killing.
Aug 18 20:38:00 arch systemd[1]: avahi-daemon.service: main process exited, code=killed, status=9/KILL
Aug 18 20:38:00 arch systemd[1]: Unit avahi-daemon.service entered failed state.
Aug 18 20:38:00 arch systemd[1]: Shutting down.

I am now going to try running with cups disabled. Again, because the issue is  intermitant, I won't know if this solved the problem very soon. Meanwhile, hopefully someone will recognize the error pattern in the journal output.

Offline

#5 2014-08-19 15:25:02

Pse
Member
Registered: 2008-03-15
Posts: 413

Re: Occasional stop job hang for avahi at shutdown

You can mask systemd unit files to keep them from running (disabling them won't do because some units can be activated by others). Bear in mind that this might break other services, but in this particular case, at least for running some tests, you could mask avahi-daemon.service and avahi-daemon.socket:

systemctl mask avahi-daemon.service
systemctl mask avahi-daemon.socket

Last edited by Pse (2014-08-19 15:26:03)

Offline

#6 2014-08-24 12:22:41

ninian
Member
From: United Kingdom
Registered: 2008-02-24
Posts: 726
Website

Re: Occasional stop job hang for avahi at shutdown

Just recently on a fully updated system I'm not getting a clean shutdown (using 'systemctl poweroff'). Though the computer powers off, when I reboot the ext4 journal needs to recover itself and there are some orphaned inodes, etc. Here's what the journalctl says:

Aug 24 00:17:20 user su[666]: pam_unix(su:session): session closed for user root
Aug 24 00:17:27 user systemd-logind[362]: System is powering down.
Aug 24 00:17:27 user xinetd[455]: Unexpected signal 18 (Continued)
Aug 24 00:17:27 user xinetd[455]: Exiting...
Aug 24 00:17:27 user ModemManager[344]: <info>  Caught signal, shutting down...
Aug 24 00:17:27 user sshd[456]: Received signal 15; terminating.
Aug 24 00:17:27 user smartd[347]: smartd received signal 15: Terminated
Aug 24 00:17:27 user smartd[347]: smartd is exiting (exit status 0)
Aug 24 00:17:27 user rpcbind[358]: rpcbind terminating on signal. Restart with "rpcbind -w"
Aug 24 00:17:27 user NetworkManager[346]: <info> ModemManager disappeared from bus
Aug 24 00:17:27 user ModemManager[344]: <info>  ModemManager is shut down
Aug 24 00:17:27 user systemd[1]: rpcbind.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Aug 24 00:17:27 user systemd[1]: Unit rpcbind.service entered failed state.
Aug 24 00:17:27 user systemd[462]: Stopping Default.
Aug 24 00:17:27 user systemd[462]: Stopped target Default.
Aug 24 00:17:27 user systemd[462]: Stopping Basic System.user
Aug 24 00:17:27 user systemd[462]: Stopped target Basic System.
Aug 24 00:17:27 user systemd[462]: Stopping Paths.
Aug 24 00:17:27 user systemd[462]: Stopped target Paths.
Aug 24 00:17:27 user systemd[462]: Stopping Timers.
Aug 24 00:17:27 user systemd[462]: Stopped target Timers.
Aug 24 00:17:27 user systemd[462]: Stopping Sockets.
Aug 24 00:17:27 user systemd[462]: Stopped target Sockets.
Aug 24 00:17:27 user systemd[462]: Starting Shutdown.
Aug 24 00:17:27 user systemd[462]: Reached target Shutdown.
Aug 24 00:17:27 user systemd[462]: Starting Exit the Session...
Aug 24 00:17:27 user vnstatd[345]: Info: Monitoring: wlp0s26u1u2 wlp0s29u1u2 enp2s0
Aug 24 00:17:27 user vnstatd[345]: Info: SIGTERM received, exiting.
Aug 24 00:17:27 user kernel: cupsd[348]: segfault at 0 ip 00007f6322cdbd94 sp 00007fffd30eabb0 error 4 in libavahi
Aug 24 00:17:27 user systemd[464]: pam_unix(systemd-user:session): session closed for user user
Aug 24 00:17:27 user NetworkManager[346]: <info> caught signal 15, shutting down normally.
Aug 24 00:17:27 user NetworkManager[346]: <info> exiting (success)
Aug 24 00:17:27 user avahi-daemon[343]: Got SIGTERM, quitting.
Aug 24 00:17:27 user avahi-daemon[343]: Leaving mDNS multicast group on interface enp2s0.IPv4 with address 192.168
Aug 24 00:17:27 user avahi-daemon[343]: avahi-daemon 0.6.31 exiting.
Aug 24 00:17:27 user dbus[351]: [system] Activating via systemd: service name='org.freedesktop.Avahi' unit='dbus-o
Aug 24 00:17:27 user dbus[351]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.Avahi.servic
Aug 24 00:17:27 user systemd[462]: Received SIGRTMIN+24 from PID 24933 (kill).
Aug 24 00:17:27 user systemd-networkd[361]: Received SIGTERM from PID 1 (systemd).
Aug 24 00:17:27 user systemd[1]: cups.service: main process exited, code=killed, status=11/SEGV
Aug 24 00:17:27 user systemd[1]: Unit cups.service entered failed state.
Aug 24 00:17:27 user NetworkManager[346]: (NetworkManager:346): GLib-CRITICAL **: Source ID 31 was not found when 
Aug 24 00:17:27 user mkinitcpio[24919]: ==> Starting build: none
Aug 24 00:17:27 user mkinitcpio[24919]: -> Running build hook: [sd-shutdown]
Aug 24 00:17:27 user mkinitcpio[24919]: ==> Build complete.
Aug 24 00:17:28 user systemd[1]: Shutting down.
Aug 24 00:17:28 user dhcpcd[413]: received signal TERM from PID 1, stopping
Aug 24 00:17:28 user dhcpcd[413]: enp2s0: removing interface
Aug 24 00:17:28 user systemd-journal[135]: Journal stopped

Maybe avahi is causing my problem too, but doesn't seem quite the same as OP's.

Offline

#7 2014-08-24 16:49:43

herOldMan
Member
Registered: 2013-10-11
Posts: 151

Re: Occasional stop job hang for avahi at shutdown

On my system, avahi is required for: libcups, remmina, and x11vnc.

The shut-down journal entry, Unit cups.service entered failed state, seemed conspicuous to me. So far, disabling the cups service and the cups-browsed service has resulted in my not having the occasional stop hang... but it's hard to know with an intermittant problem. I need cups/cups-browsed only occasionally, so manually starting them as needed is OK. I use remmina and x11vnc on this computer quite often.  If the problem shows  up again I plan to follow the smoke using Pse's recommendation.

I see the failed state for cups in ninian's output too, but the avahi-daemon happily exited.

Offline

#8 2014-10-05 16:59:48

eworm
Package Maintainer (PM)
From: Oberhausen, Germany
Registered: 2010-01-30
Posts: 105
Website

Re: Occasional stop job hang for avahi at shutdown

I do see the same here. It does not happen very often, but it gets more frustrating every time. :-/

Just to get some more ideas into discussion: Anybody of you running VPN or having virtual or tun/tap network interface?


ArchLinux - make it simple & lightweight

Offline

Board footer

Powered by FluxBB