Your message dated Mon, 14 Mar 2016 15:50:06 +0000
with message-id <[email protected]>
and subject line Bug#720338: fixed in battery-stats 0.4.0-1
has caused the Debian Bug report #720338,
regarding battery-status: Rewrite as shell script and drop the C daemon?
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
720338: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=720338
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: battery-stats
Version: 0.3.6-1
Severity: wishlist

Hi.

What about rewriting battery-status as a shell script?  The current
version is dead upstream and thanks to a misfeature in libacpi not
working very wel.  I made my own battery stats package using a shell
script called from cron every 10 minutes (not calling it more often, to
keep the disk writes low (save power on laptops).  I also added pm-utils
hooks to call it before and after the machine is hibernated, and when
the external power supply is inserted or disconnected, allowing very
detailed collection of battery status.

Would it be an idea to rewite battery-status along those lines?

This is my collector script, creating a csv file:

#!/bin/sh
# Inspired by
# http://www.ifweassume.com/2013/08/the-de-evolution-of-my-laptop-battery.html
logfile=/var/log/hjemmenett-battery-status.log
files="manufacturer model_name technology serial_number \
    energy_full energy_full_design energy_now cycle_count status"
if [ ! -e "$logfile" ] ; then
    (
        printf "timestamp,"
        for f in $files; do
            printf "%s," $f
        done
        echo
    ) > "$logfile"
fi
log_battery() {
    printf "%s," $(date +%s)
    for f in $files; do
        printf "%s," $(cat $f)
    done
    echo
}
cd /sys/class/power_supply
for bat in BAT*; do
    (cd $bat && log_battery >> "$logfile")
done


This is the script in /usr/lib/pm-utils/sleep.d/:


#!/bin/sh
# Action script to collect battery status just before and just after
# going to sleep.
#
# Copyright: Copyright (c) 2013 Petter Reinholdtsen
# License:   GPL-2+
#
PATH=/sbin:/usr/sbin:/bin:/usr/bin
case "${1}" in
    hibernate|suspend|resume|thaw)
        if [ -x /usr/sbin/collect-battery-status ]; then
            /usr/sbin/collect-battery-status
        fi
        ;;
esac


This is the script in /usr/lib/pm-utils/power.d/:


#!/bin/sh
# Action script to collect battery status when the power connector is
# inserted or removed.
#
# Copyright: Copyright (c) 2013 Petter Reinholdtsen
# License:   GPL-2+
#
PATH=/sbin:/usr/sbin:/bin:/usr/bin
case "${1}" in
    false|true)
        if [ -x /usr/sbin/collect-battery-status ]; then
            /usr/sbin/collect-battery-status
        fi
        ;;
esac


The cron.d entry look like this:

# Collect battery status ever 10 minutes
*/10 * * * *     root    if [ -x /usr/sbin/collect-battery-status ]; then 
/usr/sbin/collect-battery-status ; fi


My home made system lack graph support (I just pull the CSV file into a
spreadsheet), so perhaps those parts could be reused from the current
battery-status package?

-- 
Happy hacking
Petter Reinholdtsen

--- End Message ---
--- Begin Message ---
Source: battery-stats
Source-Version: 0.4.0-1

We believe that the bug you reported is fixed in the latest version of
battery-stats, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Petter Reinholdtsen <[email protected]> (supplier of updated battery-stats 
package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Mon, 14 Mar 2016 15:43:53 +0100
Source: battery-stats
Binary: battery-stats
Architecture: source
Version: 0.4.0-1
Distribution: unstable
Urgency: medium
Maintainer: Petter Reinholdtsen <[email protected]>
Changed-By: Petter Reinholdtsen <[email protected]>
Description:
 battery-stats - collects statistics about charge of laptop batteries
Closes: 699241 720338
Changes:
 battery-stats (0.4.0-1) unstable; urgency=medium
 .
   * New upstream release 0.4.0.
     - Collector is reimplemented as a shell script (Closes: #720338).
     - Collector is now able to follow charge level (Closes: #699241).
   * Drop desktop file now included upstream.
Checksums-Sha1:
 4e3f1c3d86d341dd8db7414d2ee187858972cf05 2032 battery-stats_0.4.0-1.dsc
 fe7a8955f83c16ec336073c335e875902992e29a 23425 battery-stats_0.4.0.orig.tar.gz
 851722cfa0b377559d838eff3e9155b0edfc7636 5380 
battery-stats_0.4.0-1.debian.tar.xz
Checksums-Sha256:
 6c27a6ea39d6b78b9f12bc8cf83b6f65cf177a06ae5d15f033d0bda11e15fc46 2032 
battery-stats_0.4.0-1.dsc
 45c1bd4404939e462e8d8effdaa972a57073086f1344c346f726b02e782604eb 23425 
battery-stats_0.4.0.orig.tar.gz
 d933dd3f2fc8674e6cea4e01a7a4c758fb1ee1f49ecfe736626a8bd44e9ec4c0 5380 
battery-stats_0.4.0-1.debian.tar.xz
Files:
 60be288b430ccb4a6bbe8410bd6cfc90 2032 admin extra battery-stats_0.4.0-1.dsc
 36cc57de676366cbddddcc6b2e1f914c 23425 admin extra 
battery-stats_0.4.0.orig.tar.gz
 4e7d46cace46ce1b1c77b5564b9e7925 5380 admin extra 
battery-stats_0.4.0-1.debian.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJW5s5fAAoJEIEoCqCHuvsO8uEP/jYZWF5LpCz7QxzCpwKp/Ylg
jYn8b0jJo05Xb/Hy1KQGb2rNq0HbaSz016FHViNG18RsJzBrzfQoVvLt0Q92fif8
X13nRr3GoL5XwJDcfyZp9D5WPBgA0XZq7oPKYR31f7kxQzVnO5CyzpOWu/rxng4P
sDVL9TOolRHtGkRlOh4mTSF2l9dqwt2/06+iA13Elf9l4W4Nkvet5ZPQbCfAEFuz
OkLdj23xG2KuoLf2IjnC7MGWE6PrcfhLJl1vgUpy3UB0nidhmLJuc4AyCAWqIPLJ
CWl/MduXKcehOND6gNMdHdHhq13FXgZvf15+53Tf1mt4JozJ1JFJezjKe7FSdDcb
h5XDmyCn6l8ByY5GxouRbjQ+MvIcjSETD29QO79LPF8iF8smg/GU5Ti2Jt+4VQ0S
37OtX8CKcF36cXPYCr+xrK1a7Ly0xAWPJ0Zq3eQO7xR4otyDY85gSPE/YdJKwZ2W
bmcAOqmuNNRZAH7Q5CiX4mcjJhb4WFanOYX8oCsVApvjBMxgefX48xHBMcnS3rxO
7YH4eAE3SNYbQ0ArUcHvfkYyHYksRLdEciOr+youG46LoskTfnPa2sNHBTR6NF5x
5zWEPuy+KwTgPw8VT4aUsV4mNhG1MI+BNpUOOPTAec97f5kIJNJ4E+UkIMFSvc8M
g1U0hFhciWNILu8lhXgj
=X3ov
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to