mirror of
https://codeberg.org/guix/guix.git
synced 2026-01-25 03:55:08 -06: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:
parent
1187020066
commit
accb75c33b
1 changed files with 7 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue