On Sun, 2015-09-27 at 16:53 +0200, Tomas Janousek wrote:
> I've been quite happy with the workaround, and it's just one of many
> workarounds I need to have on this system, so I can't promise much. 
> :-(
> 
> But there's another related issue, one you encountered already I
> think.  The
> laptop_mode script executes its modules in the background and doesn't
> wait for
> them.  But systemd kills all forked processes after a little while,
> and on my
> laptop, this little while is a little bit too early for hdparm to do
> its job.
> (And I may only wonder what else was left off.)  So I had to add
> "wait" just
> after the "for SCRIPT in /usr/share/laptop-mode-tools/modules/* ...",
> otherwise it was unpredictable what it would do.  That's something
> you might
> want to add anyway.


Thanks for mentioning this one. The "wait" was dropped because the
battery polling daemon used to inherit the lock.

commit de339d4cbd436c92c2f904424d3eb5294063073f
Author: Ritesh Raj Sarraf <[email protected]>
Date:   Mon Oct 29 23:42:07 2012 +0530

    Do not wait
    
    The wait, since it is in a lock, never gets released because we
    background the polling daemon.
    
    We will  see later if any bugs creep in with this change.


So indeed, this bug did creep in. :-)

Now that we are running in systemd for the most majority, and I think
that's what the future will hold, I'm going to bring this change back.

[lmt-upstream 56db2fb] Wait for all forked modules to complete
 1 file changed, 3 insertions(+)

The new polling method is heavily systemd based, and the old battery
polling daemon has been disabled by default. Ofcourse, for users that
are not using system, the old battery polling daemon shall still be
available.


That said, I'm not sure what you meant by systemd killing forked
processes. Me and Michael Biebl exchanged emails when he was helping me
with systemd integration for LMT. So, earlier, LMT was invoked through
udev. And udev had never guaranteed to allow a long running process to
complete.

So to overcome that buggy approach, we now have /lib/udev/lmt-udev,
which if it detects is running on systemd, will invoke systemd. And
systemd, afaik, does not have any such behavior for programs that it is
invoking by itself.





-- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to