Last active
July 27, 2017 18:04
-
-
Save anonymous/6ec8962ef6d2720b2f2a50631a132cc7 to your computer and use it in GitHub Desktop.
stdin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (rsync-shepherd-service config) | |
"Return a <shepherd-service> for rsync with CONFIG." | |
(define pid-file | |
(rsync-configuration-pid-file config)) | |
(define rsync-command | |
#~(list (string-append #$(rsync-configuration-package config) "/bin/rsync") | |
"--daemon" "--config" #$(rsync-config-file config))) | |
(define port-number | |
(rsync-configuration-port-number config)) | |
(define user | |
(if (> port-number 1024) | |
"rsyncd" | |
"root")) | |
(list (shepherd-service | |
(provision '(rsync)) | |
(documentation "Run rsync daemon.") | |
(start #~(make-forkexec-constructor #$rsync-command | |
#:pid-file #$pid-file | |
#:user #$user | |
#:group #$user)) | |
(stop #~(make-kill-destructor))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment