]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
cpupower: do not call systemctl at install time
authorFrancesco Poli (wintermute) <invernomuto@paranoici.org>
Tue, 13 May 2025 16:29:32 +0000 (18:29 +0200)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 13 May 2025 22:06:22 +0000 (16:06 -0600)
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) <invernomuto@paranoici.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/power/cpupower/Makefile
tools/power/cpupower/README

index 4ad931509eaacc6ab8b2d233205a25ac8db5e48b..7cec2c30f98a97c008c78fa01d0ed44a02cff147 100644 (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:'
index e6ae7c1e0a0d7d11e7efc2f2b98647d020641ab5..494104de154055abff578f2f7d2be8f6f5a50faa 100644 (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