<div dir="ltr">Yeah, it's tricky. <div><br></div><div>I don't think sysctl is the answer as that doesn't work with /sys</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 29, 2014 at 1:06 PM, Ivan Shapovalov <span dir="ltr"><<a href="mailto:intelfx100@gmail.com" target="_blank">intelfx100@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Wednesday 29 October 2014 at 13:00:42, Daniel Hollocher wrote:<br>
> Hey folks,<br>
> I'm a not expert here, so please forgive the low quality/interest of my<br>
> question.<br>
><br>
> I'm curious what the ideal systemd way is to set various power management<br>
> settings in the /sys tree. For me personally, I'm looking to set<br>
> sampling_down_factor as without it, ondemand has terrible performance on my<br>
> particular computer (a 10-30% loss compared to performance or conservative).<br>
><br>
> Currently, Ubuntu uses a sysv init script to set ondemand after boot, and I<br>
> could edit that. It would be cool to know the ideal systemd way, that<br>
> could also be aware of power saving stuff.<br>
><br>
> From googling, it seems that tempfiles or sysctrl is not the way to go,<br>
> since those only happen at boot. Udev? The examples I've found seem to<br>
> make basic usage of udev to detect power changes, and then drop to a script<br>
> to do the bulk of the work. Is that it?<br>
<br>
</div></div>You could write a bunch of units pulled in by a target... well, two targets,<br>
one for power-saving and second for performance mode. And then just start the<br>
targets from an udev rule. Just remember to use `--no-block` as udev kills<br>
workers after some time.<br>
<br>
I've already done something along these lines for my own purposes, see<br>
<a href="https://github.com/intelfx/power-management" target="_blank">https://github.com/intelfx/power-management</a><br>
<br>
However, I still want to know if I this is OK wrt systemd "spirit".<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Ivan Shapovalov / intelfx /</font></span></blockquote></div><br></div>