LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   systemd: replacing an init script for cpu scaling governors (http://www.linuxquestions.org/questions/linux-software-2/systemd-replacing-an-init-script-for-cpu-scaling-governors-4175424514/)

Meson 08-29-2012 12:02 AM

systemd: replacing an init script for cpu scaling governors
 
With sysvinit I had a script for setting up cpu power management. I now start it via a systemd service. I'd like opinions if you think there's a better (more systemd) way to do this.

The script is simple:
Code:

#!/bin/bash
echo -n ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo -n ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo -n ondemand > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo -n ondemand > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
echo -n 40      > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold

The current service file is:
Code:

[Unit]
Description=Configure cpufreq

[Service]
Type=oneshot
ExecStart=/usr/local/bin/config_cpufreq


NyteOwl 08-29-2012 12:45 PM

Amazing how much the service file looks like a Windows 3.1 ini file ... of course it's much like a windows app anyway.

Meson 08-29-2012 12:59 PM

Please don't troll my thread. (Thanks for the bump though.)

Yes, systemd uses the ini format, so do a lot of other projects; git, for example.

NyteOwl 08-29-2012 02:24 PM

Wasn't a troll but an observation. You're welcome for the bump.


All times are GMT -5. The time now is 01:29 AM.