(requirement `(root-file-system ,@requirements))
(documentation "Check, mount, and unmount the given file system.")
(start #~(lambda args
- (let ((device (canonicalize-device-spec #$device '#$title)))
+ ;; FIXME: Use or factorize with 'mount-file-system'.
+ (let ((device (canonicalize-device-spec #$device '#$title))
+ (flags #$(mount-flags->bit-mask flags)))
#$(if create-mount-point?
#~(mkdir-p #$target)
#~#t)
(getenv "PATH")))
(check-file-system device #$type))
#~#t)
- (mount device #$target #$type
- #$(mount-flags->bit-mask flags)
- #$options))
+
+ (mount device #$target #$type flags #$options)
+
+ ;; For read-only bind mounts, an extra remount is needed,
+ ;; as per <http://lwn.net/Articles/281157/>, which still
+ ;; applies to Linux 4.0.
+ (when (and (= MS_BIND (logand flags MS_BIND))
+ (= MS_RDONLY (logand flags MS_RDONLY)))
+ (mount device #$target #$type
+ (logior MS_BIND MS_REMOUNT MS_RDONLY))))
#t))
(stop #~(lambda args
;; Normally there are no processes left at this point, so
"Return a service that runs libc's name service cache daemon (nscd) with the
given @var{config}---an @code{<nscd-configuration>} object. Optionally,
@code{#:name-services} is a list of packages that provide name service switch
- (NSS) modules needed by nscd."
+ (NSS) modules needed by nscd. @xref{Name Service Switch}, for an example."
(mlet %store-monad ((nscd.conf (nscd.conf-file config)))
(return (service
(documentation "Run libc's name service cache daemon (nscd).")
(respawn? #f)))))
-(define (syslog-service)
- "Return a service that runs @code{syslogd} with reasonable default settings."
+(define* (syslog-service #:key config-file)
+ "Return a service that runs @code{syslogd}.
+If configuration file name @var{config-file} is not specified, use some
+reasonable default settings."
;; Snippet adapted from the GNU inetutils manual.
(define contents "
(start
#~(make-forkexec-constructor
(list (string-append #$inetutils "/libexec/syslogd")
- "--no-detach" "--rcfile" #$syslog.conf)))
+ "--no-detach" "--rcfile" #$(or config-file syslog.conf))))
(stop #~(make-kill-destructor))))))
(define* (guix-build-accounts count #:key
(with-monad %store-monad
(return (service
+ (documentation "Run the Guix daemon.")
(provision '(guix-daemon))
(requirement '(user-processes))
(start