Skip to content

Commit 4edef85

Browse files
frx-wintermuteshuahkh
authored andcommitted
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: 9c70b77 ("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>
1 parent 2a0eaa7 commit 4edef85

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

tools/power/cpupower/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ install-tools: $(OUTPUT)cpupower
312312
$(INSTALL) -d $(DESTDIR)${libdir}/systemd/system
313313
sed 's|___CDIR___|${confdir}|; s|___LDIR___|${libexecdir}|' cpupower.service.in > '$(DESTDIR)${libdir}/systemd/system/cpupower.service'
314314
$(SETPERM_DATA) '$(DESTDIR)${libdir}/systemd/system/cpupower.service'
315-
if test -d /run/systemd/system; then systemctl daemon-reload; fi
316315

317316
install-man:
318317
$(INSTALL_DATA) -D man/cpupower.1 $(DESTDIR)${mandir}/man1/cpupower.1
@@ -360,7 +359,6 @@ uninstall:
360359
- for HLANG in $(LANGUAGES); do \
361360
rm -f $(DESTDIR)${localedir}/$$HLANG/LC_MESSAGES/cpupower.mo; \
362361
done;
363-
- if test -d /run/systemd/system; then systemctl daemon-reload; fi
364362

365363
help:
366364
@echo 'Building targets:'

tools/power/cpupower/README

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ $ sudo make install
5959
-----------------------------------------------------------------------
6060
| man pages | /usr/man |
6161
-----------------------------------------------------------------------
62-
| systemd service | /usr/lib |
62+
| systemd service | /usr/lib/systemd/system |
6363
-----------------------------------------------------------------------
6464
| systemd support script | /usr/libexec |
6565
-----------------------------------------------------------------------
@@ -113,7 +113,7 @@ The files will be installed to the following dirs:
113113
-----------------------------------------------------------------------
114114
| man pages | ${DESTDIR}/usr/man |
115115
-----------------------------------------------------------------------
116-
| systemd service | ${DESTDIR}/usr/lib |
116+
| systemd service | ${DESTDIR}/usr/lib/systemd/system |
117117
-----------------------------------------------------------------------
118118
| systemd support script | ${DESTDIR}/usr/libexec |
119119
-----------------------------------------------------------------------
@@ -185,11 +185,20 @@ systemd service
185185
---------------
186186

187187
A systemd service is also provided to run the cpupower utility at boot with
188-
settings read from a configuration file. In order to enable this systemd
189-
service, edit '${DESTDIR}/etc/default/cpupower' (uncommenting at least one of
190-
the options, depending on your preferences) and then issue the following
188+
settings read from a configuration file.
189+
190+
If you want systemd to find the new service after the installation, the service
191+
unit must have been installed in one of the system unit search path directories
192+
(such as '/usr/lib/systemd/system/', which is the default location) and (unless
193+
you are willing to wait for the next reboot) you need to issue the following
191194
command:
192195

196+
$ sudo systemctl daemon-reload
197+
198+
If you want to enable this systemd service, edit
199+
'${DESTDIR}/etc/default/cpupower' (uncommenting at least one of the options,
200+
depending on your preferences) and then issue the following command:
201+
193202
$ sudo systemctl enable --now cpupower.service
194203

195204

0 commit comments

Comments
 (0)