You are not logged in.
I recently noticed that there is no AC subdirectory (and no AC/online file) in /sys/class/power_supply on my standard PC desktop running Arch Linux kernel 5.9.10-arch1-1. This silently breaks anacron, which checks for the presence of AC/online file or ADP*/online files.
The dmidecode returns:
[michal@ant ~]$ sudo dmidecode --type 39
# dmidecode 3.3
Getting SMBIOS data from sysfs.
SMBIOS 3.0.0 present.
Handle 0x005E, DMI type 39, 22 bytes
System Power Supply
Power Unit Group: 1
Location: To Be Filled By O.E.M.
Name: To Be Filled By O.E.M.
Manufacturer: To Be Filled By O.E.M.
Serial Number: To Be Filled By O.E.M.
Asset Tag: To Be Filled By O.E.M.
Model Part Number: To Be Filled By O.E.M.
Revision: To Be Filled By O.E.M.
Max Power Capacity: Unknown
Status: Present, OK
Type: Switching
Input Voltage Range Switching: Auto-switch
Plugged: Yes
Hot Replaceable: No
Input Voltage Probe Handle: 0x005A
Cooling Device Handle: 0x005C
Input Current Probe Handle: 0x005DOffline
I am sorry, I pressed "submit" too quick.
My question is whether the kernel driver should create this subdirectory (this topic is almost undocumented) and if so, how to correct or debug this problem. I am not sure if it is a hardware problem, a misconfiguration or a bug
Best,
Michal
Offline
On my desktop /sys/class/power_supply is completely empty.
Is /etc/cron.hourly/0anacron the failing job and how did you verify it failed ?
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Yes, /etc/cron.hourly/0anacron fails.
There are timeshift entries in my /etc/anacrontab and I noticed that timeshift doesn't create scheduled backups. Running 0anacron script by hand returns exit code 0, but /usr/sbin/anacron is not executed. As 0anacron returns correct exit code, there are no warnings in log files that anacron doesn't run.
This bug, if it is a bug, is quite nasty because anacron fails silently and an user may not be aware of it.
Offline
/etc/cron.hourly/0anacron
#!/bin/sh
# Check whether 0anacron was run today already
if test -r /var/spool/anacron/cron.daily; then
day=`cat /var/spool/anacron/cron.daily`
fi
if [ `date +%Y%m%d` = "$day" ]; then
exit 0
fi
# Do not run jobs when on battery power
online=1
for psupply in AC ADP{0..9} ; do
sysfile="/sys/class/power_supply/$psupply/online"
if [ -f $sysfile ] ; then
if [ `cat $sysfile 2>/dev/null`x = 1x ]; then
online=1
break
else
online=0
fi
fi
done
if [ $online = 0 ]; then
exit 0
fi
/usr/sbin/anacron -s if [ -f $sysfile ] ; then
if [ `cat $sysfile 2>/dev/null`x = 1x ]; then
online=1
break
else
online=0
fishould never result in changing online value if AC / ADP folders are not present.
On such systems the value of online should still be 1 after the for loop has run.
That results in /usr/sbin/anacron -s beign executed .
Post your /etc/anacrontab .
also # journactl --since 2020-11-26 -g cron and /var/log/crond.log (if it exists)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline