GNU bug report logs - #40937
[PATCH] services: syslog: Simplify 'start' method.

Previous Next

Package: guix-patches;

Reported by: Diego Nicola Barbato <dnbarbato <at> posteo.de>

Date: Tue, 28 Apr 2020 13:24:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

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 40937 in the body.
You can then email your comments to 40937 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#40937; Package guix-patches. (Tue, 28 Apr 2020 13:24:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Diego Nicola Barbato <dnbarbato <at> posteo.de>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 28 Apr 2020 13:24:02 GMT) Full text and rfc822 format available.

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

From: Diego Nicola Barbato <dnbarbato <at> posteo.de>
To: guix-patches <at> gnu.org
Subject: [PATCH] services: syslog: Simplify 'start' method.
Date: Tue, 28 Apr 2020 15:22:58 +0200
[Message part 1 (text/plain, inline)]
Hey Guix,

This patch simplifies the 'start' method of 'syslog-service-type' by
setting the umask using the new #:file-creation-mask parameter of
'make-forkexec-constructor', which was introduced in version 0.8.0 of
the Shepherd, instead of wrapping the constructor in a lambda.

Regards,

Diego

[0001-services-syslog-Simplify-start-method.patch (text/x-patch, inline)]
From 5ac4af21427afb8ef498b0de7151f116a6f7d9eb Mon Sep 17 00:00:00 2001
From: Diego Nicola Barbato <dnbarbato <at> posteo.de>
Date: Tue, 28 Apr 2020 13:31:54 +0200
Subject: [PATCH] services: syslog: Simplify 'start' method.

This is a followup to d7113bb655ff80a868a9e624c913f9d23e6c63ad and
e3358a831e7d5d9e8dc614340e49ea5aeb11a7ff.

* gnu/services/base.scm (syslog-service-type): Change 'start' method to set
  umask using the #:file-creation-mask parameter of
  'make-forkexec-constructor' introduced in version 0.8.0 of the Shepherd.
---
 gnu/services/base.scm | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 2913478e4a..0f119cc2f9 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1316,17 +1316,13 @@ Service Switch}, for an example."
       (documentation "Run the syslog daemon (syslogd).")
       (provision '(syslogd))
       (requirement '(user-processes))
-      (start #~(let ((spawn (make-forkexec-constructor
-                             (list #$(syslog-configuration-syslogd config)
-                                   "--rcfile"
-                                   #$(syslog-configuration-config-file config))
-                             #:pid-file "/var/run/syslog.pid")))
-                 (lambda ()
-                   ;; Set the umask such that file permissions are #o640.
-                   (let ((mask (umask #o137))
-                         (pid  (spawn)))
-                     (umask mask)
-                     pid))))
+      (start #~(make-forkexec-constructor
+                (list #$(syslog-configuration-syslogd config)
+                      "--rcfile"
+                      #$(syslog-configuration-config-file config))
+                ;; Set the umask such that file permissions are #o640.
+                #:file-creation-mask #o137
+                #:pid-file "/var/run/syslog.pid"))
       (stop #~(make-kill-destructor))))))
 
 ;; Snippet adapted from the GNU inetutils manual.
-- 
2.26.0


Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Fri, 01 May 2020 22:00:03 GMT) Full text and rfc822 format available.

Notification sent to Diego Nicola Barbato <dnbarbato <at> posteo.de>:
bug acknowledged by developer. (Fri, 01 May 2020 22:00:03 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Diego Nicola Barbato <dnbarbato <at> posteo.de>
Cc: 40937-done <at> debbugs.gnu.org
Subject: Re: [bug#40937] [PATCH] services: syslog: Simplify 'start' method.
Date: Fri, 01 May 2020 23:59:07 +0200
Hi,

Diego Nicola Barbato <dnbarbato <at> posteo.de> skribis:

>>From 5ac4af21427afb8ef498b0de7151f116a6f7d9eb Mon Sep 17 00:00:00 2001
> From: Diego Nicola Barbato <dnbarbato <at> posteo.de>
> Date: Tue, 28 Apr 2020 13:31:54 +0200
> Subject: [PATCH] services: syslog: Simplify 'start' method.
>
> This is a followup to d7113bb655ff80a868a9e624c913f9d23e6c63ad and
> e3358a831e7d5d9e8dc614340e49ea5aeb11a7ff.
>
> * gnu/services/base.scm (syslog-service-type): Change 'start' method to set
>   umask using the #:file-creation-mask parameter of
>   'make-forkexec-constructor' introduced in version 0.8.0 of the Shepherd.

Perfect!  Applied, thanks.

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 30 May 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 167 days ago.

Previous Next


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