mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 21:20:33 +02:00
services: tlp: Make destructor return #f on success.
* gnu/services/pm.scm (tlp-shepherd-service): Make destructor return #f on success. Destructor "should return #f if it is now possible again to start the service at a later point" (shepherd manual). Change-Id: Ic0d21d32af158da1ae940d9c32c05a3471767764 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
committed by
Ludovic Courtès
parent
1187020066
commit
accb75c33b
@@ -2,6 +2,7 @@
|
||||
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||
;;; Copyright © 2024 Dariqq <dariqq@posteo.net>
|
||||
;;; Copyright © 2024 Ian Eure <ian@retrospec.tv>
|
||||
;;; Copyright © 2025 Nigko Yerden <nigko.yerden@gmail.com>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
@@ -459,15 +460,17 @@ performance, balance_performance, default, balance_power and power."))
|
||||
(define (tlp-shepherd-service config)
|
||||
(let* ((tlp-bin (file-append
|
||||
(tlp-configuration-tlp config) "/sbin/tlp"))
|
||||
(tlp-action (lambda args
|
||||
(tlp-action (lambda (return-value-on-success . args)
|
||||
#~(lambda _
|
||||
(zero? (system* #$tlp-bin #$@args))))))
|
||||
(if (zero? (system* #$tlp-bin #$@args))
|
||||
#$return-value-on-success
|
||||
(not #$return-value-on-success))))))
|
||||
(list (shepherd-service
|
||||
(documentation "Run TLP script.")
|
||||
(provision '(tlp))
|
||||
(requirement '(user-processes))
|
||||
(start (tlp-action "init" "start"))
|
||||
(stop (tlp-action "init" "stop"))))))
|
||||
(start (tlp-action #t "init" "start"))
|
||||
(stop (tlp-action #f "init" "stop"))))))
|
||||
|
||||
(define (tlp-activation config)
|
||||
(let* ((config-str (with-output-to-string
|
||||
|
||||
Reference in New Issue
Block a user