diff options
| author | Nigko Yerden <nigko.yerden@gmail.com> | 2026-06-14 11:14:20 +0500 |
|---|---|---|
| committer | Maxim Cournoyer <maxim@guixotic.coop> | 2026-06-16 14:25:14 +0900 |
| commit | 8215ee8419871fac6f69404f4b1f035a467693e5 (patch) | |
| tree | ef1fb59d88e474bda309b8ff29be7738313635af /gnu/services | |
| parent | 98d0f9e6b52dddcb6e47db70dfa010eb75263ce2 (diff) | |
services: autossh: Add shepherd-provision configuration option.
Allow to have several autossh services in system configuration.
gnu/services/ssh.scm (autossh-configuration)[shepherd-provision]: New field.
(autossh-file-name): Use first symbol from shepherd-provision as a base name
for the runtime autossh directory.
(autossh-shepherd-service)[shepherd-service]{provision}: Set to shepherd-provison.
doc/guix.texi (Networking Services)[autossh-configuration]: Document it.
Merges: !9285
Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop>
Diffstat (limited to 'gnu/services')
| -rw-r--r-- | gnu/services/ssh.scm | 14 |
1 files changed, 9 insertions, 5 deletions
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") |
