WantedBy=sleep.target would start intel-undervolt.service before going to sleep. then undervolt config got lost due to recover from sleep.
instead. /etc/systemd/system/sleep.target.d/undervolt.conf
[Unit]
OnSuccess=intel-undervolt.service
is the correct way to start undervolt after recover from sleep.
and, sleep.target is A special target unit that is pulled in by suspend.target, hibernate.target, suspend-then-hibernate.target, and hybrid-sleep.target and may be used to hook units into the sleep state logic. thus dont need to specify suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target manually
WantedBy=sleep.targetwould start intel-undervolt.service before going to sleep. then undervolt config got lost due to recover from sleep.instead.
/etc/systemd/system/sleep.target.d/undervolt.confis the correct way to start undervolt after recover from sleep.
and, sleep.target is
A special target unit that is pulled in by suspend.target, hibernate.target, suspend-then-hibernate.target, and hybrid-sleep.target and may be used to hook units into the sleep state logic.thus dont need to specifysuspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.targetmanually