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
1 changed files with 7 additions and 11 deletions

View File

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