emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#49365: closed ([PATCH] services: gpm: Use "make-forkexec-contstructo


From: GNU bug Tracking System
Subject: bug#49365: closed ([PATCH] services: gpm: Use "make-forkexec-contstructor".)
Date: Tue, 13 Jul 2021 05:29:01 +0000

Your message dated Tue, 13 Jul 2021 07:28:21 +0200
with message-id <87mtqqok96.fsf_-_@waegenei.re>
and subject line Re: bug#49365: [PATCH] services: gpm: Use 
"make-forkexec-contstructor".
has caused the debbugs.gnu.org bug report #49365,
regarding [PATCH] services: gpm: Use "make-forkexec-contstructor".
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
49365: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=49365
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH] services: gpm: Use "make-forkexec-contstructor". Date: Sat, 3 Jul 2021 22:40:28 +0200
* 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




--- End Message ---
--- Begin Message --- Subject: Re: bug#49365: [PATCH] services: gpm: Use "make-forkexec-contstructor". Date: Tue, 13 Jul 2021 07:28:21 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
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.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]