On 14.10.2012 19:21, Michael Stapelberg wrote: > Hi, > > I can reproduce this problem in a freshly installed VM with systemd > 44-4, samba 2:3.6.6-3, ifupdown 0.7.2 and "auto eth0" and "iface eth0 > inet dhcp" in /etc/network/interfaces (Using "allow-hotplug eth0" > instead of "auto eth0" does not trigger the problem for me). > > Note that an easy workaround is to unplug your network cable while > booting, which will lead to DHCP timeouts and thus not triggering the > hook. > > Also, my previous mail was wrong: This is not precisely the same issue > as #635777 (though related). > > I debugged this by unchecking "cable connected" in virtualbox and using > the same technique as described in my previous mail. I gather from the > logfiles that networking.service (generated from LSB > /etc/init.d/networking) is of Type=forking and thus systemd blocks until > its process exits. > > Now, when you have a network connection, /etc/init.d/networking will > blockingly get a DHCP lease, then call the hook, which in turn calls > invoke-rc.d samba reload, which gets diverted to systemctl reload > samba.service. > > The problem is that systemctl reload blocks by default (unless > --no-block is given) and thus it waits until systemd actually does the > reload. However, systemd cannot do that right now, since it is waiting > for networking.service to complete, thus we’re in a deadlock. > > Summary: systemd blocks on networking.service, networking.service’s > systemctl blocks on systemd → deadlock.
As discussed on IRC: I think there is a bit more to that then the above explanation. If you run "systemctl reload" on a non-running service, it will *not* block and simply returns immediately. So this can't explain the problem above. From past discussions with Lennart, I think the problem is, that systemd tries to minimize unnecessary actions. Say during an transaction, a service is started and reloaded. systemd will try to reorder the service so it can avoid the reload. I guess in this case this means blocking, until the actual start happens. And then we indeed get the deadlock. As my memory is a bit vague here, I've CCed Lennart, since I don't want to tell nonsense. Lennart, I hope you can chime in here and shed some light on this problem. Cheers, Michael -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?
signature.asc
Description: OpenPGP digital signature