Skip to content

Instantly share code, notes, and snippets.

/stdin.scm

Last active Jul 27, 2017
Embed
What would you like to do?
stdin
(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
You can’t perform that action at this time.