On 08/02/2011 12:10 AM, Cristian Ionescu-Idbohrn wrote:
>       failed (disabled, not active).
>       ...
>       failed (enabled, not active).
>
> Package promises much, but is (sadly) unusable :(  Thus removed.
22:55:01 rrs@champaran:~/devel/apt-offline/apt-offline (debian)$ sudo
/etc/init.d/laptop-mode restart
[sudo] password for rrs:
Disabling laptop mode...done (8514
disabled, not active).
Enabling laptop mode...done (enabled, not active).
01:20:27 rrs@champaran:~/devel/apt-offline/apt-offline (debian)$ sudo
/etc/init.d/laptop-mode restart
Disabling laptop mode...done (20610
disabled, not active
20610).
Enabling laptop mode...done (20610
enabled, active
20610).

>
> Now, it's essential scripting stuff.  You just don't do:
>
>       return 0;
>
> Maybe:
>
>       exit 0
>
> which would mean "ignore all errors that may have occured", but how
> smart would that be?
Exactly. Can you test and report this?

> Just skip that all together and handle errors as they may occur,
> instead.  That would be smarter, indeed.
This would be better. I haven't tested what the default return is. If
you can test, that'll be great. With the new 1.58 release, the last
snippet in the laptop_mode script is the lm-polling-daemon invocation.
Now its exit status could be different depending on the various
circumstances (number of events, invocations etc). So you testing will
help here.
> That script is in a deplorable hackish state :( I doubt _all_ those
> forked subshells '(...)' are really necessary, for example.  Would you
> be intrested in getting patches?  Is there a debian repository you
> keep the code in?
Yes. https://github.com/rickysarraf/laptop-mode-tools

> Kernel: Linux 2.6.39-2-686-pae (SMP w/2 CPU cores)
> Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
> Shell: /bin/sh linked to /bin/bash
Debian defaults to dash. And that is what laptop-mode-tools tries to
adhere to. But that doesn't mean it shouldn't work with bash.
Can you try with dash as your system default shell?

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


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to