3 ms·
I find that I can tune the battery life on a ThinkPad to be pretty amazing, but it is hard to get my change to stick after a reboot or even a suspend/wake cycle
by jeffbee 6y ago
I find that I can tune the battery life on a ThinkPad to be pretty amazing, but it is hard to get my change to stick after a reboot or even a suspend/wake cycle. One of the things that seems to make a big impact is PCIe ASPM. But where do you change your config files so it's always on? At least on Ubuntu there are numerous config files that formerly controlled power management settings, are still referenced in Stack Overflow answers, still exist on the filesystem, but don't actually do one damn thing, which is infuriating.
Used to be able to just drop commands into rc.local but now it's not as simple.
- lmilcin 6y agoI have a bunch of scripts that run on every start and wakeup. Some of those scripts do things like configure my machine depending on where I am (for example, detect presence of my home WiFi).
- jeffbee 6y agoIt doesn't seem like you'd be able to do that on wakeup. Don't you have to put those kinds of commands in a hook that runs after a wifi link state change?
- lmilcin 6y agoI am not sure what you mean. As bad as it is, systemd actually supports running stuff on wakeup. One figures, it has support for everything.
- jeffbee 6y agoWhat I mean is that when the machine wakes up, it's not associated with a wifi network until later, so isn't it a race if such a thing runs at wakeup?
- boring_twenties 6y agoOK so we sleep for 30 seconds and try again, maybe give up after 5 or 10 iterations of this. What's the problem?
- lmilcin 6y agoOr have a script running on when network comes up and you check if you just freshly came from the sleep.
- deleted 6y ago[deleted]
- imglorp 6y agoCrontab has an @reboot key which is convenient for quick hacks without making a whole systemd unit. Speaking of systemd, "man systemd-rc-local-generator" alleges you can still create an rc.local and it will handle it.
- catdog 6y ago> Used to be able to just drop commands into rc.local but now it's not as simple. Why not? Also you can try https://linrunner.de/tlp/ https://linrunner.de/tlp/
- yrro 6y ago(For the benefit of anyone who is wondering) A Type=oneshot systemd service that is WantedBy=sysinit.target (for early-ish boot) or multi-user.target (for late-ish boot) is the rough equivalent of an entry in /etc/rc.local. The bootup(7) man page shows how these targets fit into the bootup process. That said, systemd-rc-local-generator(1) provides backwards-compatibility with /etc/rc.local, so putting stuff in there should still work. Any output or error messages will be logged by the rc-local.service unit.