There are 2 issues with the up script as is:
- Any instance of if, if it exits, exits the whole script, if not in foreground { }. Source: https://skarnet.org/software/execline/if.html
- Command line switches are missing.
Here's my fixed version:
#!/bin/execlineb -P
envfile /etc/default/cpupower
importas -uD "" governor governor
importas -uD "" min_freq min_freq
importas -uD "" max_freq max_freq
importas -uD "" freq freq
importas -uD "" mc_scheduler mc_scheduler
importas -uD "" smp_scheduler smp_scheduler
importas -uD "" perf_bias perf_bias
# frequency options
foreground { if -t { test ${governor} } cpupower frequency-set -g ${governor} }
foreground { if -t { test ${min_freq} } cpupower frequency-set -d ${min_freq} }
foreground { if -t { test ${max_freq} } cpupower frequency-set -u ${max_freq} }
foreground { if -t { test ${freq} } cpupower frequency-set -f ${freq} }
# cpu options
foreground { if -t { test ${mc_scheduler} } cpupower set -m ${mc_scheduler} }
foreground { if -t { test ${smp_scheduler} } cpupower set -s ${smp_scheduler} }
foreground { if -t { test ${perf_bias} } cpupower set -b ${perf_bias} }
Thanks for catching this one. What name and email would you like for me to use to credit you in the commit?
Pushed it here (https://gitea.artixlinux.org/artix/s6-services/commit/09a504e555f361938ec2eac2674fe006b8866035) and just built the updated package. Thanks again!