diff options
| author | Nigko Yerden <nigko.yerden@gmail.com> | 2026-06-14 10:36:04 +0500 |
|---|---|---|
| committer | Maxim Cournoyer <maxim@guixotic.coop> | 2026-06-16 14:24:46 +0900 |
| commit | 98d0f9e6b52dddcb6e47db70dfa010eb75263ce2 (patch) | |
| tree | f110773a83de2e781bec524fa4169f51b726a31d | |
| parent | a25b934e1a6c1c8a4f1246ab16f54ca1fea47aae (diff) | |
services: autossh: Add auto-start? configuration option.
gnu/services/ssh.scm (autossh-configuration)[auto-start?]: New field.
(autossh-shepherd-service)[shepherd-service]{auto-start?}: New field.
doc/guix.texi (Networking Services)[autossh-configuration]: Document it.
Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop>
| -rw-r--r-- | doc/guix.texi | 4 | ||||
| -rw-r--r-- | gnu/services/ssh.scm | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 6bf2ca4f1ad..aee2fc329fb 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -25034,6 +25034,10 @@ The list of command-line arguments to pass to @command{ssh} when it is | |||
| 25034 | run. Options @option{-f} and @option{-M} are reserved for AutoSSH and | 25034 | run. Options @option{-f} and @option{-M} are reserved for AutoSSH and |
| 25035 | may cause undefined behaviour. | 25035 | may cause undefined behaviour. |
| 25036 | 25036 | ||
| 25037 | @item @code{auto-start?} (default @code{#t}) | ||
| 25038 | Whether this service should be started automatically by the Shepherd. If it | ||
| 25039 | is @code{#f}, the service has to be started manually with @command{herd start}. | ||
| 25040 | |||
| 25037 | @end table | 25041 | @end table |
| 25038 | @end deftp | 25042 | @end deftp |
| 25039 | 25043 | ||
diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm index d5c1c778009..675a15b6350 100644 --- a/gnu/services/ssh.scm +++ b/gnu/services/ssh.scm | |||
| @@ -622,7 +622,9 @@ object." | |||
| 622 | (port autossh-configuration-port | 622 | (port autossh-configuration-port |
| 623 | (default "0")) | 623 | (default "0")) |
| 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? | ||
| 627 | (default #t))) | ||
| 626 | 628 | ||
| 627 | (define (autossh-file-name config file) | 629 | (define (autossh-file-name config file) |
| 628 | "Return a path in /var/run/autossh/ that is writable | 630 | "Return a path in /var/run/autossh/ that is writable |
| @@ -670,7 +672,8 @@ object." | |||
| 670 | (autossh-configuration-message config)) | 672 | (autossh-configuration-message config)) |
| 671 | #$(string-append "AUTOSSH_PORT=" | 673 | #$(string-append "AUTOSSH_PORT=" |
| 672 | (autossh-configuration-port config))))) | 674 | (autossh-configuration-port config))))) |
| 673 | (stop #~(make-kill-destructor)))) | 675 | (stop #~(make-kill-destructor)) |
| 676 | (auto-start? (autossh-configuration-auto-start? config)))) | ||
| 674 | 677 | ||
| 675 | (define (autossh-service-activation config) | 678 | (define (autossh-service-activation config) |
| 676 | (with-imported-modules '((guix build utils)) | 679 | (with-imported-modules '((guix build utils)) |
