unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#49365] [PATCH] services: gpm: Use "make-forkexec-contstructor".
@ 2021-07-03 20:40 Brice Waegeneire
  2021-07-07 14:30 ` Mathieu Othacehe
  0 siblings, 1 reply; 3+ messages in thread
From: Brice Waegeneire @ 2021-07-03 20:40 UTC (permalink / raw)
  To: 49365

* gnu/services/base.scm (gpm-shepherd-service)[start]: Replace custom
logic with "make-forkexec-constructor".
---
 gnu/services/base.scm | 24 +++++++-----------------
 1 file 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")
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#49365] [PATCH] services: gpm: Use "make-forkexec-contstructor".
  2021-07-03 20:40 [bug#49365] [PATCH] services: gpm: Use "make-forkexec-contstructor" Brice Waegeneire
@ 2021-07-07 14:30 ` Mathieu Othacehe
  2021-07-13  5:28   ` bug#49365: " Brice Waegeneire
  0 siblings, 1 reply; 3+ messages in thread
From: Mathieu Othacehe @ 2021-07-07 14:30 UTC (permalink / raw)
  To: Brice Waegeneire; +Cc: 49365


Hello Brice,

> * gnu/services/base.scm (gpm-shepherd-service)[start]: Replace custom
> logic with "make-forkexec-constructor".

This seems fine, thanks!

Mathieu




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#49365: [PATCH] services: gpm: Use "make-forkexec-contstructor".
  2021-07-07 14:30 ` Mathieu Othacehe
@ 2021-07-13  5:28   ` Brice Waegeneire
  0 siblings, 0 replies; 3+ messages in thread
From: Brice Waegeneire @ 2021-07-13  5:28 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 49365-done

Mathieu Othacehe <othacehe@gnu.org> writes:

>> * gnu/services/base.scm (gpm-shepherd-service)[start]: Replace custom
>> logic with "make-forkexec-constructor".

Thank you for the review, pushed as
1beeef62614dc61876558bcd70af11e2bd6854d6.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-13  5:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-03 20:40 [bug#49365] [PATCH] services: gpm: Use "make-forkexec-contstructor" Brice Waegeneire
2021-07-07 14:30 ` Mathieu Othacehe
2021-07-13  5:28   ` bug#49365: " Brice Waegeneire

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).