On Sun, 23.11.14 12:34, Andrei Borzenkov (arvidj...@gmail.com) wrote:

> В Fri, 21 Nov 2014 01:26:36 +0100
> Lennart Poettering <lenn...@poettering.net> пишет:
> 
> > On Thu, 20.11.14 19:56, Lukasz Stelmach (stl...@poczta.fm) wrote:
> > 
> > > I talked to the kernel guys at my office and they told me that it is
> > > quite usual (at least for USB devices, and my wlan and bt are USB)
> > > that devices are stopped and unregistered in the kernel before
> > > a system is suspended end reported as completely new ones
> > > with increased numbers after machine resumes.
> > 
> > So, I have now added some code that adds BindsTo= for the device unit
> > to the service. This won't fix much though, as the service is likely
> > to fail in ExecStop= because it cannot find the device anymore.
> > 
> 
> Yes, you are right. It accumulates the same services but now failed
> instead of active.
> 
> Hmm ... should not systemd inform service that device it is BoundTo is
> gone? I mean, while service may need to do some cleanup in this case,
> it is obvious that it cannot access device which no more exists. This
> would allow graceful exit, instead of returning error. 

Well, it's racy really. Of course systemd sends SIGTERM before
shutting down a service, but this is async...

Lennart

-- 
Lennart Poettering, Red Hat
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to