log is filled with warnings, causing graph generation to fail
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
battery-stats (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
battery-graph shows empty graphs.
Cause: the battery-log on my system looks like this:
No power supply found
1549454931 94.23 1 2019/02/06 13:08:51 -
No power supply found
1549454991 94.57 1 2019/02/06 13:09:51 -
This is because the power adapter in /sys/class/
$ ls /sys/class/
AC0 BAT0
And the relevant section from /usr/sbin/
if [ -f /sys/class/
elif [ -f /sys/class/
elif [ -f /sys/class/
else
echo "No power supply found"
fi
Just removing the else and echo statements at least makes the 'No power supply found' warning messages to go away from the log, and battery-graph works again.
Another fix would be to add AC0 to the tested directories, for example by replacing all of the tests above by:
for d in /sys/class/
if test -f $d; then
aconline=$(cat $d)
break;
fi;
done
See also:
https:/
Thanks,
ProblemType: Bug
DistroRelease: Ubuntu 18.10
Package: battery-stats 0.5.6-1 [modified: usr/sbin/
ProcVersionSign
Uname: Linux 4.18.0-13-generic x86_64
ApportVersion: 2.20.10-0ubuntu13.1
Architecture: amd64
CurrentDesktop: i3
Date: Wed Feb 6 13:07:41 2019
InstallationDate: Installed on 2019-01-16 (20 days ago)
InstallationMedia: Ubuntu 18.10 "Cosmic Cuttlefish" - Release amd64 (20181017.3)
SourcePackage: battery-stats
UpgradeStatus: No upgrade log present (probably fresh install)