services: syslog: Simplify 'start' method.

This is a followup to d7113bb655 and
e3358a831e.

* 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.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Diego Nicola Barbato 2020-04-28 13:31:54 +02:00 committed by Ludovic Courtès
parent 61586ce9a2
commit 4c0cc7bed3
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -1316,17 +1316,13 @@ (define syslog-service-type
(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.