diff options
author | Brice Waegeneire <brice@waegenei.re> | 2021-07-03 20:07:07 +0200 |
---|---|---|
committer | Brice Waegeneire <brice@waegenei.re> | 2021-07-13 07:24:52 +0200 |
commit | 1beeef62614dc61876558bcd70af11e2bd6854d6 (patch) | |
tree | 831f90a7be8947320e3c71a36d1f841a3cb99e19 /gnu/services | |
parent | acfeccd8daa6f2046f538f3e96a92566c442dc11 (diff) | |
download | guix-1beeef62614dc61876558bcd70af11e2bd6854d6.tar guix-1beeef62614dc61876558bcd70af11e2bd6854d6.tar.gz |
services: gpm: Use "make-forkexec-contstructor".
* gnu/services/base.scm (gpm-shepherd-service)[start]: Replace custom
logic with "make-forkexec-constructor".
Diffstat (limited to 'gnu/services')
-rw-r--r-- | gnu/services/base.scm | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 6922d7f90b..ab3e441a7b 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -2217,23 +2217,13 @@ instance." (list (shepherd-service (requirement '(udev)) (provision '(gpm)) - (start #~(lambda () - ;; 'gpm' runs in the background and sets a PID file. - ;; Note that it requires running as "root". - (false-if-exception (delete-file "/var/run/gpm.pid")) - (fork+exec-command (list #$(file-append gpm "/sbin/gpm") - #$@options)) - - ;; Wait for the PID file to appear; declare failure if - ;; it doesn't show up. - (let loop ((i 3)) - (or (file-exists? "/var/run/gpm.pid") - (if (zero? i) - #f - (begin - (sleep 1) - (loop (1- i)))))))) - + ;; 'gpm' runs in the background and sets a PID file. + ;; Note that it requires running as "root". + (start #~(make-forkexec-constructor + (list #$(file-append gpm "/sbin/gpm") + #$@options) + #:pid-file "/var/run/gpm.pid" + #:pid-file-timeout 3)) (stop #~(lambda (_) ;; Return #f if successfully stopped. (not (zero? (system* #$(file-append gpm "/sbin/gpm") |