GNU bug report logs - #49365
[PATCH] services: gpm: Use "make-forkexec-contstructor".

Previous Next

Package: guix-patches;

Reported by: Brice Waegeneire <brice <at> waegenei.re>

Date: Sat, 3 Jul 2021 20:41:02 UTC

Severity: normal

Tags: patch

Done: Brice Waegeneire <brice <at> waegenei.re>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 49365 in the body.
You can then email your comments to 49365 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#49365; Package guix-patches. (Sat, 03 Jul 2021 20:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Brice Waegeneire <brice <at> waegenei.re>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 03 Jul 2021 20:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: guix-patches <at> gnu.org
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





Information forwarded to guix-patches <at> gnu.org:
bug#49365; Package guix-patches. (Wed, 07 Jul 2021 14:32:01 GMT) Full text and rfc822 format available.

Message #8 received at 49365 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Brice Waegeneire <brice <at> waegenei.re>
Cc: 49365 <at> debbugs.gnu.org
Subject: Re: bug#49365: [PATCH] services: gpm: Use
 "make-forkexec-contstructor".
Date: Wed, 07 Jul 2021 16:30:59 +0200
Hello Brice,

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

This seems fine, thanks!

Mathieu




Reply sent to Brice Waegeneire <brice <at> waegenei.re>:
You have taken responsibility. (Tue, 13 Jul 2021 05:29:01 GMT) Full text and rfc822 format available.

Notification sent to Brice Waegeneire <brice <at> waegenei.re>:
bug acknowledged by developer. (Tue, 13 Jul 2021 05:29:02 GMT) Full text and rfc822 format available.

Message #13 received at 49365-done <at> debbugs.gnu.org (full text, mbox):

From: Brice Waegeneire <brice <at> waegenei.re>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 49365-done <at> debbugs.gnu.org
Subject: Re: bug#49365: [PATCH] services: gpm: Use
 "make-forkexec-contstructor".
Date: Tue, 13 Jul 2021 07:28:21 +0200
Mathieu Othacehe <othacehe <at> 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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 10 Aug 2021 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 259 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.