Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-07 Thread Lennart Poettering
On Fri, 03.04.15 19:37, Andrei Borzenkov (arvidj...@gmail.com) wrote: > В Fri, 3 Apr 2015 14:04:10 +0200 > Lennart Poettering пишет: > > > On Thu, 02.04.15 16:28, Martin Pitt (martin.p...@ubuntu.com) wrote: > > > > > Lennart Poettering [2015-04-02 13:03 +0200]: > > > > Yeah, and rightfully so.

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-06 Thread Dan Williams
On Fri, 2015-04-03 at 14:01 +0200, Lennart Poettering wrote: > On Thu, 02.04.15 15:04, Simon McVittie (simon.mcvit...@collabora.co.uk) wrote: > > > On 02/04/15 14:31, Lennart Poettering wrote: > > > Hmm? I really don't see how the NFS vs wpa_supplicant issue has > > > anything to do with dbus? NFS

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-04 Thread Martin Pitt
Lennart Poettering [2015-04-03 14:06 +0200]: > Well, it sounds really wrong btw, if NM shuts down the ifaces just > because it got kicked off the bus... That's massively wrong. It doesn't -- wpa_supplicant does. Martin -- Martin Pitt| http://www.piware.de Ubuntu Developer

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-03 Thread Andrei Borzenkov
В Fri, 3 Apr 2015 14:04:10 +0200 Lennart Poettering пишет: > On Thu, 02.04.15 16:28, Martin Pitt (martin.p...@ubuntu.com) wrote: > > > Lennart Poettering [2015-04-02 13:03 +0200]: > > > Yeah, and rightfully so. I mean, a service really should be able to > > > shutdown if dbus is dead. In fact, i

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-03 Thread Lennart Poettering
On Thu, 02.04.15 20:55, Kurt von Laven (k...@endlessm.com) wrote: > On a separate note, how long does systemd wait after sending a SIGTERM to a > service before sending it a SIGKILL? 90s. This may be configured per-service in TimeoutStopSec= and globally with DefaultTimeoutStopSec= in system.con

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-03 Thread Lennart Poettering
On Thu, 02.04.15 22:28, Martin Pitt (martin.p...@ubuntu.com) wrote: > Hello, > > Dan Williams [2015-04-02 9:51 -0500]: > > On Thu, 2015-04-02 at 16:31 +0200, Martin Pitt wrote: > > > wpa_supplicant and NM already have Before=network.target which is even > > > stronger. But that doesn't help -- i

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-03 Thread Lennart Poettering
On Thu, 02.04.15 16:31, Martin Pitt (martin.p...@ubuntu.com) wrote: > Lennart Poettering [2015-04-02 15:31 +0200]: > > You need to order wpa_supplicant and NM Before=remote-fs-pre.target > > and pull it it via Wants=remote-fs-pre.target. With that in place > > during shutdown the mounts will be un

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-03 Thread Lennart Poettering
On Thu, 02.04.15 16:28, Martin Pitt (martin.p...@ubuntu.com) wrote: > Lennart Poettering [2015-04-02 13:03 +0200]: > > Yeah, and rightfully so. I mean, a service really should be able to > > shutdown if dbus is dead. In fact, it should be able to shutdown in > > pretty much any situation... > > T

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-03 Thread Lennart Poettering
On Thu, 02.04.15 15:04, Simon McVittie (simon.mcvit...@collabora.co.uk) wrote: > On 02/04/15 14:31, Lennart Poettering wrote: > > Hmm? I really don't see how the NFS vs wpa_supplicant issue has > > anything to do with dbus? NFS doesn't care about dbus at all... > > It does inasmuch as it requires

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-03 Thread Martin Pitt
Hello, Dan Williams [2015-04-02 9:51 -0500]: > On Thu, 2015-04-02 at 16:31 +0200, Martin Pitt wrote: > > wpa_supplicant and NM already have Before=network.target which is even > > stronger. But that doesn't help -- it's D-Bus which we need to leave > > running longer, as dbus going down early tea

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-02 Thread Andrei Borzenkov
On Fri, Apr 3, 2015 at 6:55 AM, Kurt von Laven wrote: > > On a separate note, how long does systemd wait after sending a SIGTERM to a > service before sending it a SIGKILL? http://www.freedesktop.org/software/systemd/man/systemd.kill.html ___ systemd-de

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-02 Thread Kurt von Laven
Actually I think I just answered my own question and in the process realized that I didn't provide enough context in my original question. There is a race condition in my code because when service B receives SIGTERM, it calls g_dbus_connection_flush_sync

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-02 Thread Kurt von Laven
Both services A and B specify Requires=dbus.service and After=dbus.service. If I am interpreting everything that's being said correctly, there is a race condition in my code since service A's implementation doesn't require it to wait until it has processed the method call from service B before it s

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-02 Thread Dan Williams
On Thu, 2015-04-02 at 16:31 +0200, Martin Pitt wrote: > Lennart Poettering [2015-04-02 15:31 +0200]: > > You need to order wpa_supplicant and NM Before=remote-fs-pre.target > > and pull it it via Wants=remote-fs-pre.target. With that in place > > during shutdown the mounts will be unmounted first,

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-02 Thread Dan Williams
On Thu, 2015-04-02 at 15:04 +0100, Simon McVittie wrote: > On 02/04/15 14:31, Lennart Poettering wrote: > > Hmm? I really don't see how the NFS vs wpa_supplicant issue has > > anything to do with dbus? NFS doesn't care about dbus at all... > > It does inasmuch as it requires networking to be up, w

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-02 Thread Martin Pitt
Lennart Poettering [2015-04-02 15:31 +0200]: > You need to order wpa_supplicant and NM Before=remote-fs-pre.target > and pull it it via Wants=remote-fs-pre.target. With that in place > during shutdown the mounts will be unmounted first, and NM/wpa only > shut down after that. wpa_supplicant and NM

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-02 Thread Martin Pitt
Lennart Poettering [2015-04-02 13:03 +0200]: > Yeah, and rightfully so. I mean, a service really should be able to > shutdown if dbus is dead. In fact, it should be able to shutdown in > pretty much any situation... They do, but that's irrelevant here. The problem is that dbus.service shuts down v

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-02 Thread Simon McVittie
On 02/04/15 14:31, Lennart Poettering wrote: > Hmm? I really don't see how the NFS vs wpa_supplicant issue has > anything to do with dbus? NFS doesn't care about dbus at all... It does inasmuch as it requires networking to be up, which *might* require dbus (e.g. for NetworkManager). > You need to

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-02 Thread Lennart Poettering
On Thu, 02.04.15 13:07, Michael Biebl (mbi...@gmail.com) wrote: > 2015-04-02 13:03 GMT+02:00 Lennart Poettering : > > On Thu, 02.04.15 13:00, Michael Biebl (mbi...@gmail.com) wrote: > > > >> 2015-04-02 11:06 GMT+02:00 Lennart Poettering : > >> > If you want to ensure that bus communication still w

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-02 Thread Michael Biebl
2015-04-02 13:03 GMT+02:00 Lennart Poettering : > On Thu, 02.04.15 13:00, Michael Biebl (mbi...@gmail.com) wrote: > >> 2015-04-02 11:06 GMT+02:00 Lennart Poettering : >> > If you want to ensure that bus communication still works in your >> > shutdown code, you hence need to make sure you place >> >

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-02 Thread Lennart Poettering
On Thu, 02.04.15 13:00, Michael Biebl (mbi...@gmail.com) wrote: > 2015-04-02 11:06 GMT+02:00 Lennart Poettering : > > If you want to ensure that bus communication still works in your > > shutdown code, you hence need to make sure you place > > After=dbus.service in your services, so that you are s

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-02 Thread Michael Biebl
2015-04-02 11:06 GMT+02:00 Lennart Poettering : > If you want to ensure that bus communication still works in your > shutdown code, you hence need to make sure you place > After=dbus.service in your services, so that you are shut down before > dbus is. Type=dbus service currently only get a depend

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-02 Thread Lennart Poettering
On Wed, 01.04.15 18:22, Kurt von Laven (k...@endlessm.com) wrote: > Hello folks, > > I am trying to ensure that my system DBus service has time to handle a DBus > method call before it shuts down. My DBus service is implemented as a > system systemd service; let's call it service A. It runs a sin

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-01 Thread Kurt von Laven
Thanks for the quick reply, Andrei. It sounds like there is indeed a race condition in my code then since there is nothing explicit in my implementation of service A that makes it wait until it has processed the method call from service B before it stops listening for method calls. Did I get that r

Re: [systemd-devel] Synchronization Between Services at Shutdown

2015-04-01 Thread Andrei Borzenkov
В Wed, 1 Apr 2015 18:22:50 -0700 Kurt von Laven пишет: > Hello folks, > > I am trying to ensure that my system DBus service has time to handle a DBus > method call before it shuts down. My DBus service is implemented as a > system systemd service; let's call it service A. It runs a single-thread