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: 9c70b779ad ("cpupower: add a systemd service to run cpupower")
Signed-off-by: Francesco Poli (wintermute) <invernomuto@paranoici.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
Francesco Poli (wintermute) 2025-05-13 18:29:32 +02:00 committed by Shuah Khan
parent 2a0eaa78ff
commit 4edef850a1
2 changed files with 14 additions and 7 deletions

View File

@ -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:'

View File

@ -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