all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#40937] [PATCH] services: syslog: Simplify 'start' method.
@ 2020-04-28 13:22 Diego Nicola Barbato
  2020-05-01 21:59 ` bug#40937: " Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Diego Nicola Barbato @ 2020-04-28 13:22 UTC (permalink / raw)
  To: 40937

[-- Attachment #1: Type: text/plain, Size: 297 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-services-syslog-Simplify-start-method.patch --]
[-- Type: text/x-patch, Size: 2038 bytes --]

From 5ac4af21427afb8ef498b0de7151f116a6f7d9eb Mon Sep 17 00:00:00 2001
From: Diego Nicola Barbato <dnbarbato@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


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

* bug#40937: [PATCH] services: syslog: Simplify 'start' method.
  2020-04-28 13:22 [bug#40937] [PATCH] services: syslog: Simplify 'start' method Diego Nicola Barbato
@ 2020-05-01 21:59 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2020-05-01 21:59 UTC (permalink / raw)
  To: Diego Nicola Barbato; +Cc: 40937-done

Hi,

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

>>From 5ac4af21427afb8ef498b0de7151f116a6f7d9eb Mon Sep 17 00:00:00 2001
> From: Diego Nicola Barbato <dnbarbato@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’.




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

end of thread, other threads:[~2020-05-01 22:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28 13:22 [bug#40937] [PATCH] services: syslog: Simplify 'start' method Diego Nicola Barbato
2020-05-01 21:59 ` bug#40937: " Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.