I decided to investigate. First, find the file name:
# systemctl list-unit-files purism-power-optimisations.service
...
# locate purism-power-optimisations
/etc/systemd/system/multi-user.target.wants/purism-power-optimisations.service
...
Checking it out:
# grep -i exec /etc/systemd/system/multi-user.target.wants/purism-power-optimisations.service
ExecStart=/usr/lib/pureos-power-optimisations/apply
OK, so that’s the file it wants to start, which doesn’t exist on my system!
# ls /usr/lib/pureos*
ls: cannot access '/usr/lib/pureos*': No such file or directory
I wonder whether the simple thing we need to do is change that line and use /usr/lib/purism-power-optimisations/purism-power-optimisations instead. If I run it:
# /usr/lib/purism-power-optimisations/purism-power-optimisations
vm.dirty_writeback_centisecs = 6000
modprobe cpufreq_stats failedLoaded 217 prior measurements
RAPL device for cpu 0
RAPL Using PowerCap Sysfs : Domain Mask f
RAPL device for cpu 0
RAPL Using PowerCap Sysfs : Domain Mask f
Devfreq not enabled
To show power estimates do 8 measurement(s) connected to battery only
Leaving PowerTOP
I have no idea if this is what we want to do. On the last line, it calls powertop --auto-tune. That doesn’t sound too bad!
What do you think?
OK, so now I’m wondering where this error originates. I have a file on the disk and a different file that is wanted. Let’s look at the packages involved.
# dpkg -S /usr/lib/purism-power-optimisations/purism-power-optimisations
purism-power-optimisations: /usr/lib/purism-power-optimisations/purism-power-optimisations
root@melanobombus:/home/alex# apt show purism-power-optimisations
Package: purism-power-optimisations
Version: 0.5.0
Priority: optional
Section: misc
Source: purism-device-config
Maintainer: PureOS Developers <pureos-project@lists.puri.sm>
Installed-Size: 425 kB
Depends: dmidecode, iw, powertop
Homepage: https://source.puri.sm/pureos/packages/purism-device-config
Download-Size: 11.8 kB
APT-Manual-Installed: no
APT-Sources: https://repo.puri.sm/pureos green/main amd64 Packages
Description: Power/battery optimisations for Purism devices
Installing this package will apply a number of power/battery optimisationson
system start.
.
Purism laptops are specifically detected; installing this package on a
non-Purism device will succeed but will do nothing at boot time.
OK, perhaps I can just reinstall this package and it’ll fix itself?
root@melanobombus:/home/alex# apt install --reinstall purism-power-optimisations
...
Setting up purism-power-optimisations (0.5.0) ...
Job for purism-power-optimisations.service failed because the control process exited with error code.
See "systemctl status purism-power-optimisations.service" and "journalctl -xe" for details.
Same problem!
So how about the systemd service?
# for f in $(locate purism-power-optimisations.service); do dpkg -S $f; done
dpkg-query: no path found matching pattern /etc/systemd/system/multi-user.target.wants/purism-power-optimisations.service
purism-power-optimisations: /lib/systemd/system/purism-power-optimisations.service
dpkg-query: no path found matching pattern /var/lib/systemd/deb-systemd-helper-enabled/purism-power-optimisations.service.dsh-also
dpkg-query: no path found matching pattern /var/lib/systemd/deb-systemd-helper-enabled/multi-user.target.wants/purism-power-optimisations.service
OK, so /lib/systemd/system/purism-power-optimisations.service is the file that’s provided by the same package. This should match. So, does it have the right ExecStart in there? Nope:
# grep -i exec /lib/systemd/system/purism-power-optimisations.service
ExecStart=/usr/lib/pureos-power-optimisations/apply
Still the wrong target. This is a bug in purism-power-optimisations and I’m going to file a bug.