summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/guix.texi3
-rw-r--r--gnu/services/ssh.scm14
2 files changed, 12 insertions, 5 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index aee2fc329fb..a38a04096ca 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -25038,6 +25038,9 @@ may cause undefined behaviour.
25038Whether this service should be started automatically by the Shepherd. If it 25038Whether this service should be started automatically by the Shepherd. If it
25039is @code{#f}, the service has to be started manually with @command{herd start}. 25039is @code{#f}, the service has to be started manually with @command{herd start}.
25040 25040
25041@item @code{shepherd-provision} (default: @code{'(autossh)})
25042The list of symbols defining the name(s) of the Shepherd service.
25043
25041@end table 25044@end table
25042@end deftp 25045@end deftp
25043 25046
diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm
index 675a15b6350..ddb985e51bb 100644
--- a/gnu/services/ssh.scm
+++ b/gnu/services/ssh.scm
@@ -624,19 +624,23 @@ object."
624 (ssh-options autossh-configuration-ssh-options 624 (ssh-options autossh-configuration-ssh-options
625 (default '())) 625 (default '()))
626 (auto-start? autossh-configuration-auto-start? 626 (auto-start? autossh-configuration-auto-start?
627 (default #t))) 627 (default #t))
628 (shepherd-provision autossh-configuration-shepherd-provision
629 (default '(autossh))))
628 630
629(define (autossh-file-name config file) 631(define (autossh-file-name config file)
630 "Return a path in /var/run/autossh/ that is writable 632 "Return a path in /var/run/autossh/ that is writable
631 by @code{user} from @code{config}." 633 by @code{user} from @code{config}."
632 (string-append "/var/run/autossh/" 634 (string-append "/var/run/"
633 (autossh-configuration-user config) 635 (symbol->string
634 "/" file)) 636 (first (autossh-configuration-shepherd-provision config))) "/"
637 (autossh-configuration-user config) "/"
638 file))
635 639
636(define (autossh-shepherd-service config) 640(define (autossh-shepherd-service config)
637 (shepherd-service 641 (shepherd-service
638 (documentation "Automatically set up ssh connections (and keep them alive).") 642 (documentation "Automatically set up ssh connections (and keep them alive).")
639 (provision '(autossh)) 643 (provision (autossh-configuration-shepherd-provision config))
640 (requirement '(user-processes)) 644 (requirement '(user-processes))
641 (start #~(make-forkexec-constructor 645 (start #~(make-forkexec-constructor
642 (list #$(file-append autossh "/bin/autossh") 646 (list #$(file-append autossh "/bin/autossh")