From: Francesco Poli (wintermute) Date: Tue, 13 May 2025 16:29:32 +0000 (+0200) Subject: cpupower: do not call systemctl at install time X-Git-Tag: v6.16-rc1~160^2^2^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4edef850a15c761039a50c119dbc8769b08ca45b;p=thirdparty%2Fkernel%2Flinux.git cpupower: do not call systemctl at install time Fix the installation procedure for the systemd service unit 'cpupower.service'. Do not call "systemctl daemon-reload" in the Makefile, but explain when this command should be manually issued in the README file. Link: https://lore.kernel.org/linux-pm/20250509002206.bd2519ba52035d47c3c32aa6@paranoici.org/T/#mfbb938f9c0d5a21173acb92a061eb9205fd0abfe Link: https://lore.kernel.org/r/20250513163937.61062-4-invernomuto@paranoici.org Fixes: 9c70b779ad91 ("cpupower: add a systemd service to run cpupower") Signed-off-by: Francesco Poli (wintermute) Signed-off-by: Shuah Khan --- diff --git a/tools/power/cpupower/Makefile b/tools/power/cpupower/Makefile index 4ad931509eaac..7cec2c30f98a9 100644 --- a/tools/power/cpupower/Makefile +++ b/tools/power/cpupower/Makefile @@ -312,7 +312,6 @@ install-tools: $(OUTPUT)cpupower $(INSTALL) -d $(DESTDIR)${libdir}/systemd/system sed 's|___CDIR___|${confdir}|; s|___LDIR___|${libexecdir}|' cpupower.service.in > '$(DESTDIR)${libdir}/systemd/system/cpupower.service' $(SETPERM_DATA) '$(DESTDIR)${libdir}/systemd/system/cpupower.service' - if test -d /run/systemd/system; then systemctl daemon-reload; fi install-man: $(INSTALL_DATA) -D man/cpupower.1 $(DESTDIR)${mandir}/man1/cpupower.1 @@ -360,7 +359,6 @@ uninstall: - for HLANG in $(LANGUAGES); do \ rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo; \ done; - - if test -d /run/systemd/system; then systemctl daemon-reload; fi help: @echo 'Building targets:' diff --git a/tools/power/cpupower/README b/tools/power/cpupower/README index e6ae7c1e0a0d7..494104de15405 100644 --- a/tools/power/cpupower/README +++ b/tools/power/cpupower/README @@ -59,7 +59,7 @@ $ sudo make install ----------------------------------------------------------------------- | man pages | /usr/man | ----------------------------------------------------------------------- -| systemd service | /usr/lib | +| systemd service | /usr/lib/systemd/system | ----------------------------------------------------------------------- | systemd support script | /usr/libexec | ----------------------------------------------------------------------- @@ -113,7 +113,7 @@ The files will be installed to the following dirs: ----------------------------------------------------------------------- | man pages | ${DESTDIR}/usr/man | ----------------------------------------------------------------------- -| systemd service | ${DESTDIR}/usr/lib | +| systemd service | ${DESTDIR}/usr/lib/systemd/system | ----------------------------------------------------------------------- | systemd support script | ${DESTDIR}/usr/libexec | ----------------------------------------------------------------------- @@ -185,11 +185,20 @@ systemd service --------------- A systemd service is also provided to run the cpupower utility at boot with -settings read from a configuration file. In order to enable this systemd -service, edit '${DESTDIR}/etc/default/cpupower' (uncommenting at least one of -the options, depending on your preferences) and then issue the following +settings read from a configuration file. + +If you want systemd to find the new service after the installation, the service +unit must have been installed in one of the system unit search path directories +(such as '/usr/lib/systemd/system/', which is the default location) and (unless +you are willing to wait for the next reboot) you need to issue the following command: +$ sudo systemctl daemon-reload + +If you want to enable this systemd service, edit +'${DESTDIR}/etc/default/cpupower' (uncommenting at least one of the options, +depending on your preferences) and then issue the following command: + $ sudo systemctl enable --now cpupower.service