[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#894906: linux-cpupower: provide a systemd service and a default config file



Control: tags -1 + patch


On Thu, 05 Apr 2018 14:38:37 +0200 Pavel Kreuzt <pkreuzt@gmail.com> wrote:
[...]
> linux-cpupower should be run at boot time, but no systemd service
> is installed, nor default config file is present in /etc/default.
> At least an example config should be provided as in cpufrequtils package.

Dear Debian Kernel Team,
cpufrequtils is going to be removed from Debian, and linux-cpupower is
a good replacement, see the comment in bug [#877016].

[#877016]: <https://bugs.debian.org/877016#54>

The only missing piece in linux-cpupower seems to be a systemd service
unit and a configuration file in /etc/default/ .

I took a look at how this is done in the [Arch Linux package]

[Arch Linux package]: <https://gitlab.archlinux.org/archlinux/packaging/packages/linux-tools>

It seems to me that three files (released under "GPL-2.0-or-later"
terms) can be used with trivial modifications.

The attached files are working fine on my system, where I purged
cpufrequtils and installed linux-cpupower and then I issued the
following commands:

  # cp cpupower.default /etc/default/cpupower
  # chown root:root /etc/default/cpupower
  # chmod 644 /etc/default/cpupower
  # cp cpupower.systemd /usr/libexec/cpupower
  # chown root:root /usr/libexec/cpupower
  # chmod 755 /usr/libexec/cpupower
  # cp cpupower.service /usr/lib/systemd/system/ 
  # chown root:root /usr/lib/systemd/system/cpupower.service
  # chmod 644 /usr/lib/systemd/system/cpupower.service
  # systemctl daemon-reload
  # systemctl enable cpupower.service

The systemd service runs at boot and sets everything needed with
cpupower (as configured in /etc/default/cpupower ).


Is there room for improvement?
Yes, I think there is.
For instance, the script /usr/libexec/cpupower could be translated to
POSIX shell, getting rid of its bashisms.
However, even with room for improvement, I think it's better than
nothing.

I believe it's time to fill this gap for good.
Please accept the "patch" and incorporate the files (or enhanced
versions of them) into linux-cpupower.

Thanks for your time and dedication!
Bye.



-- 
 http://www.inventati.org/frx/
 There's not a second to spare! To the laboratory!
..................................................... Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE

Attachment: cpupower.default
Description: Binary data

Attachment: cpupower.service
Description: Binary data

Attachment: cpupower.systemd
Description: Binary data

Attachment: pgp1wZ81KatCc.pgp
Description: PGP signature


Reply to: