Your message dated Sun, 22 May 2016 10:19:30 +0000
with message-id <[email protected]>
and subject line Bug#822238: fixed in battery-stats 0.5.3-1
has caused the Debian Bug report #822238,
regarding battery-stats: systemd reports odd service
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.)


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

I was plyaing around with battery-stats and noticed this odd message
from systemd.



rrs@learner:~$ sudo /etc/init.d/battery-stats status
[sudo] password for rrs: 
● battery-stats.service - LSB: start/stop the battery statistics collector
   Loaded: loaded (/etc/init.d/battery-stats; bad; vendor preset: enabled)
   Active: active (exited) since Fri 2016-04-22 16:23:41 IST; 1min 5s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 7235 ExecStop=/etc/init.d/battery-stats stop (code=exited, 
status=0/SUCCESS)
  Process: 7243 ExecStart=/etc/init.d/battery-stats start (code=exited, 
status=0/SUCCESS)
    Tasks: 0 (limit: 512)

Apr 22 16:23:41 learner systemd[1]: Starting LSB: start/stop the battery 
statistics collector..
Apr 22 16:23:41 learner battery-stats[7243]: Starting Battery statistics 
collector: battery-sta
Apr 22 16:23:41 learner systemd[1]: Started LSB: start/stop the battery 
statistics collector.


I also noticed that there was no daemon process running.


rrs@learner:~$ cat /var/run/battery-stats-collector.pid 
7250
2016-04-22 / 16:27:21 ♒♒♒  ☺  
rrs@learner:~$ ps aux | grep 7250
rrs       7841  0.0  0.0  12752  2344 pts/1    S+   16:27   0:00 grep 
--color=auto 7250
2016-04-22 / 16:27:27 ♒♒♒  ☺  


And manually trying to run it resulted in the following:


rrs@learner:~$ sudo battery-stats-collector 
[sudo] password for rrs: 
cat: /sys/class/power_supply/AC/online: No such file or directory
2016-04-22 / 16:28:17 ♒♒♒  ☹  => 1  


Ah!! I remember something. That's standard path what you lookup for. I
did the same with Laptop Mode Tools until I realized that my newer
Lenovo Yoga 2 had a different naming for the power supply.


rrs@learner:~$ tree /sys/class/power_supply/ACAD/
/sys/class/power_supply/ACAD/
├── device -> ../../../ACPI0003:00
├── online
├── power
│   ├── async
│   ├── autosuspend_delay_ms
│   ├── control
│   ├── runtime_active_kids
│   ├── runtime_active_time
│   ├── runtime_enabled
│   ├── runtime_status
│   ├── runtime_suspended_time
│   ├── runtime_usage
│   ├── wakeup
│   ├── wakeup_abort_count
│   ├── wakeup_active
│   ├── wakeup_active_count
│   ├── wakeup_count
│   ├── wakeup_expire_count
│   ├── wakeup_last_time_ms
│   ├── wakeup_max_time_ms
│   └── wakeup_total_time_ms
├── subsystem -> ../../../../../../../../class/power_supply
├── type
└── uevent

3 directories, 21 files
2016-04-22 / 16:30:42 ♒♒♒  ☺  


I've attached a patch. I think your assumptions that the paths is sysfs
are valid and persistent could be wrong.


-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 'unstable'), 
(101, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.5.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_IN.utf8, LC_CTYPE=en_IN.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages battery-stats depends on:
ii  gzip       1.6-5
ii  logrotate  3.8.7-2

Versions of packages battery-stats recommends:
ii  gnuplot            4.6.6-3
ii  libtext-csv-perl   1.33-1
ii  python             2.7.11-1
ii  python-matplotlib  1.5.1-1+b2

battery-stats suggests no packages.

-- no debconf information
--- a/src/battery-stats-collector
+++ b/src/battery-stats-collector
@@ -22,7 +22,14 @@
     secstamp=$(date +%s)
     stamp=$(date +"%Y/%m/%d %H:%M:%S")
 
-    aconline=$(cat /sys/class/power_supply/AC/online)
+    if [ -f /sys/class/power_supply/AC/online ]; then
+        aconline=$(cat /sys/class/power_supply/AC/online)
+    elif [ -f /sys/class/power_supply/ACAD/online ]; then
+        aconline=$(cat /sys/class/power_supply/ACAD/online)
+    else
+        echo "No power supply found"
+    fi
+
     if [ 1 = "$aconline" ]; then
         state=2
     else

--- End Message ---
--- Begin Message ---
Source: battery-stats
Source-Version: 0.5.3-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: Sun, 22 May 2016 11:19:27 +0200
Source: battery-stats
Binary: battery-stats
Architecture: source
Version: 0.5.3-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: 819683 822238
Changes:
 battery-stats (0.5.3-1) unstable; urgency=medium
 .
   * New upstream version 0.5.3.
     - Now handle hardware with ACAD power source (Closes: #822238).
     - No longer install non-working battery-stats-graph-gnuplot
       (Closes: #819683).
   * Updated Standards-Version from 3.9.7 to 3.9.8.
   * Remove Antonio Radici as uploader.  Thank you for maintaining the
     package for so long.
   * Added new fix-desktop-entry.patch to fix graph drawing when selected
     from desktop menu.
Checksums-Sha1:
 38a518504d32a54f53e7323df5dd85e4ed69a790 2070 battery-stats_0.5.3-1.dsc
 09fc9cc0de894d503b23164f4fd413c81e6e20ca 30493 battery-stats_0.5.3.orig.tar.gz
 1c3582203d7a80734c0e536487d6dc0901534199 6648 
battery-stats_0.5.3-1.debian.tar.xz
Checksums-Sha256:
 7ad34933ad8d2c4745eacdeffa1b55b1e31afe7ff898e924baef33b77b705a9f 2070 
battery-stats_0.5.3-1.dsc
 ef26cdf68572332a4ba5c57e93bfb0c544e4e55ae4c7080b3c7f57ff196742c9 30493 
battery-stats_0.5.3.orig.tar.gz
 9b81ffa52ac3f12a78ec18afb1237446acb48aa700676394b27a928540897887 6648 
battery-stats_0.5.3-1.debian.tar.xz
Files:
 8d297fa9939f248d7da389fc643aec39 2070 admin extra battery-stats_0.5.3-1.dsc
 adcb226771c257697e7ffdd1adf938d5 30493 admin extra 
battery-stats_0.5.3.orig.tar.gz
 6e46c4a46d5f8915bf0e1086e8a4f2ed 6648 admin extra 
battery-stats_0.5.3-1.debian.tar.xz

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

iQIcBAEBCAAGBQJXQXnSAAoJEIEoCqCHuvsO1HUP/jTHmQeum9nRwdXbr+m5T+KY
7GXmInD920XHJ9foeALeesTUlKxrQJHZTr+1i63Oa42VU3C/Q3fvOMYa3sNTHsJx
Re27YV0x344nMUXyBmPBezdIBgYCydeeelhnim+ohQSq4o93Xk1ueDzPFdz0rjJ9
b6NI3W3/DWbptcPagFelBKiAqNvdX4wScsHB26R6/xE+3zAqaof544Ts2Wg4sAe2
qOMYf93HFyUMKZ7fbht3jvbMI2FQwwUIemKWHc8VsbOilyoDlDxlkVv91m7HJm8V
OXBHIb2JNzYP3nuca59ep0J6Qq/QI93KxBIWV5OSG/HkyKjrTtzLghm77rIhBV3I
i7NAy9ppOSSso4NRqpGRlg1bxw/639yGIqsZR4c+MAF0di6MhNUMOAgkLxkTRbXB
k4Rn9xhnBB88uIpxW5PXWHVI3a+jYUh7VV0LIjlJbOCBcKbziCCVpFhs7mXx8YTw
eGH3dm/33ljf/+fuYh4OiRqC2INallSseEuAi0tfsqp3O4CbgEcwpS6G9VOpyQFj
3/HfY3Qre5jlHSiAlJgzYoRzjTIFNu7PeA7hz7WAIqz+oaFroTHx3rdrcbsxz6uQ
Fkv3w5ClAQbpsqrlp6KmtKBBqOxduJkgNyyETMl68GlQAdJ3zPx/ii3sM2qDVeBY
/jdOCyBBWRtPnZYyKA4U
=wqTv
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to