systemd service fails to run with "ConditionACPower=true was not met"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fedora 36, plocate-1.1.15-3.fc36.x86_64, systemd-250.8-1.fc36.x86_64

/usr/lib/systemd/system/plocate-updatedb.service has
ConditionACPower=true because they don't want updatedb to run
when on a laptop battery.

Now, my machine is an Intel NUC which has an Intel mobile chipset but
is very definitely not a laptop.  It doesn't have a battery and always
runs off AC power.

But ...

  $ sudo systemctl status plocate-updatedb.service |& cat
  ○ plocate-updatedb.service - Update the plocate database
       Loaded: loaded (/usr/lib/systemd/system/plocate-updatedb.service; static)
       Active: inactive (dead)
  TriggeredBy: ● plocate-updatedb.timer
    Condition: start condition failed at Fri 2022-08-05 10:29:57 BST; 5min ago
               └─ ConditionACPower=true was not met

  Aug 03 14:59:37 dev5 systemd[1]: plocate-updatedb.service - Update the plocate database was skipped because of a failed condition check (ConditionACPower=true).
  Aug 04 09:29:21 dev5 systemd[1]: plocate-updatedb.service - Update the plocate database was skipped because of a failed condition check (ConditionACPower=true).
  Aug 05 10:29:35 dev5 systemd[1]: plocate-updatedb.service - Update the plocate database was skipped because of a failed condition check (ConditionACPower=true).
  Aug 05 10:29:57 dev5 systemd[1]: plocate-updatedb.service - Update the plocate database was skipped because of a failed condition check (ConditionACPower=true).

Looking at systemd sources it seems as if ConditionACPower is checked
here:

  https://github.com/systemd/systemd/blob/14e7bc2e77d2699498a1f74d7e4f905f11eca335/src/shared/udev-util.c#L662

It's a bit hard to follow what the code is doing, but I think it's
looking in /sys for power_supply devices.  This hardware has two, both
with type == USB.  (I believe these are the two USB ports on the front
panel that can provide power to other devices, they cannot power the
machine itself.)

  $ ll /sys/devices/platform/USBC000:00/power_supply
  total 0
  drwxr-xr-x. 5 root root 0 Aug  3 09:00 ucsi-source-psy-USBC000:001
  drwxr-xr-x. 5 root root 0 Aug  3 09:00 ucsi-source-psy-USBC000:002
  $ cat /sys/devices/platform/USBC000:00/power_supply/*/type
  USB
  USB

  $ cat /sys/devices/platform/USBC000\:00/power_supply/ucsi-source-psy-USBC000\:00*/device/typec/port*/power_role 
  [sink]
  [sink]
  [sink]
  [sink]

  $ cat /sys/devices/platform/USBC000\:00/power_supply/ucsi-source-psy-USBC000\:00*/online
  0
  0

Anyway, I think this is a systemd bug, right?

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux