diff options
author | Lennart Poettering <lennart@poettering.net> | 2023-07-03 13:36:08 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2023-07-03 17:38:42 +0200 |
commit | c65e3d7a9b4f25f2e83ac859bab359b8f8377eb1 (patch) | |
tree | 5c06f8239138ab931beb564040963a065851e861 /units/systemd-battery-check.service.in | |
parent | Merge pull request #28230 from yuwata/network-wait-address-configure (diff) | |
download | systemd-c65e3d7a9b4f25f2e83ac859bab359b8f8377eb1.tar.xz systemd-c65e3d7a9b4f25f2e83ac859bab359b8f8377eb1.zip |
units: skip systemd-battery-check in environments where it doesn't make sense
Let's condition the service so that it doesn't run where we aren't
directly run on baremetal, or where no power sources are discovered at
all.
Diffstat (limited to 'units/systemd-battery-check.service.in')
-rw-r--r-- | units/systemd-battery-check.service.in | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/units/systemd-battery-check.service.in b/units/systemd-battery-check.service.in index 3de8ba1d8e..61f4ae16e0 100644 --- a/units/systemd-battery-check.service.in +++ b/units/systemd-battery-check.service.in @@ -10,8 +10,10 @@ [Unit] Description=Check battery level during early boot Documentation=man:systemd-battery-check.service(8) -DefaultDependencies=no +ConditionVirtualization=no +ConditionDirectoryNotEmpty=/sys/class/power_supply/ AssertPathExists=/etc/initrd-release +DefaultDependencies=no After=plymouth-start.service Before=initrd-root-device.target |