2018-08-25 23:39:06 +02:00
|
|
|
[Unit]
|
|
|
|
Description=OpenBSD Secure Shell server
|
2023-10-30 17:51:44 +01:00
|
|
|
After=network.target{{ (__sshd_service_after is none) | ternary('', ' ' ~ __sshd_service_after) }}
|
|
|
|
{% if __sshd_service_wants is string %}
|
|
|
|
Wants={{ __sshd_service_wants }}
|
|
|
|
{% elif __sshd_service_wants is iterable %}
|
|
|
|
{% for file in __sshd_service_wants %}
|
|
|
|
Wants={{ file }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2022-09-26 16:43:15 +02:00
|
|
|
Documentation=man:sshd(8) man:sshd_config(5)
|
2018-08-25 23:39:06 +02:00
|
|
|
|
|
|
|
[Service]
|
2022-09-26 16:43:15 +02:00
|
|
|
Type=notify
|
2023-10-30 17:51:44 +01:00
|
|
|
{% if __sshd_environment_file is string %}
|
|
|
|
EnvironmentFile=-{{ __sshd_environment_file }}
|
|
|
|
{% elif __sshd_environment_file is iterable %}
|
|
|
|
{% for file in __sshd_environment_file %}
|
|
|
|
EnvironmentFile=-{{ file }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2018-08-25 23:39:06 +02:00
|
|
|
ExecStartPre={{ sshd_binary }} -t
|
2023-10-30 17:51:44 +01:00
|
|
|
ExecStart={{ sshd_binary }} -D {{ __sshd_environment_variable }} -f {% if sshd_main_config_file is not none %}
|
|
|
|
{{- sshd_main_config_file }}
|
|
|
|
{% else %}
|
|
|
|
{{- sshd_config_file }}
|
|
|
|
{% endif %}
|
2018-08-25 23:39:06 +02:00
|
|
|
ExecReload={{ sshd_binary }} -t
|
|
|
|
ExecReload=/bin/kill -HUP $MAINPID
|
|
|
|
KillMode=process
|
|
|
|
Restart=on-failure
|
2023-10-30 17:51:44 +01:00
|
|
|
{% if __sshd_service_restart_timeout is not none %}
|
|
|
|
RestartSec={{ __sshd_service_restart_timeout }}
|
|
|
|
{% endif %}
|
2018-08-25 23:39:06 +02:00
|
|
|
RestartPreventExitStatus=255
|
2023-10-30 14:27:37 +01:00
|
|
|
{% if __sshd_runtime_directory is not none %}
|
2022-09-26 16:43:15 +02:00
|
|
|
RuntimeDirectory={{ __sshd_runtime_directory }}
|
|
|
|
RuntimeDirectoryMode={{ __sshd_runtime_directory_mode }}
|
2023-10-30 14:27:37 +01:00
|
|
|
{% endif %}
|
2018-08-25 23:39:06 +02:00
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
2023-10-30 17:51:44 +01:00
|
|
|
{% if __sshd_service_alias is not none %}
|
|
|
|
Alias={{ __sshd_service_alias }}.service
|
|
|
|
{% endif %}
|