Я создал и включил службу systemd, которая запускается вручную, но не запускается автоматически -после перезагрузки. Как мне понять, почему он не запускается автоматически -?

Используйте конфигурацию ProxyJump:

ProxyJump
Specifies one or more jump proxies as either [user@]host[:port] or an ssh URI. Multiple proxies may be separated by comma characters and will be visited sequentially. Setting this option will cause ssh(1) to connect to the target host by first making a ssh(1) connection to the specified ProxyJump host and then establishing a TCP forwarding to the ultimate target from there.

scp -o ProxyJump=user@intermediate user@target:/path
0
07.10.2021, 17:42
1 ответ

Ваша служба будет запущена только при загрузке в режиме восстановления:

[Install]
WantedBy=rescue.target
rescue.target

    A special target unit that pulls in the base system (including system mounts) and spawns a rescue shell. Isolate to this target in order to administer the system in single-user mode with all file systems mounted but with no services running, except for the most basic.

(из https://www.freedesktop.org/software/systemd/man/systemd.special.html#rescue.target).

Вы действительно хотите, чтобы ваш сервис запускался при активации мульти -user.target:

multi-user.target

    A special target unit for setting up a multi-user system (non-graphical). This is pulled in by graphical.target.

    Units that are needed for a multi-user system shall add Wants= dependencies for their unit to this unit during installation. This is best configured via WantedBy=multi-user.target in the unit's [Install] section.

(https://www.freedesktop.org/software/systemd/man/systemd.special.html#multi-user.target)

0
08.10.2021, 08:35

Теги

Похожие вопросы