Ini adalah file unit saya dari layanan systemd:
[Unit]
Description=Tunnel For %i
After=network.target
[Service]
User=autossh
ExecStart=/usr/bin/autossh -M 0 -N -o "ExitOnForwardFailure yes" -o "ConnectTimeout=1" -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -R 40443:installserver:40443 -R 8080:installserver:8080 tunnel@%i
Restart=always
[Install]
WantedBy=multi-user.target
Unit gagal 15 hari yang lalu dan systemd tidak memulai ulang, meskipun "Restart = always" ada di file unit di atas.
Di sini keluaran status dari layanan ini:
salt:/srv # systemctl status autossh@eins-work
autossh@eins-work.service - Tunnel For eins-work
Loaded: loaded (/etc/systemd/system/autossh@.service; enabled)
Active: failed (Result: start-limit) since Wed, 2016-02-10 14:33:34 CET; 2 weeks and 1 days ago
Main PID: 17980 (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/autossh@.service/eins-work
Feb 10 14:33:34 salt systemd[1]: Stopping Tunnel For eins-work...
Feb 10 14:33:34 salt systemd[1]: Starting Tunnel For eins-work...
Feb 10 14:33:34 salt systemd[1]: Failed to start Tunnel For eins-work.
Feb 10 14:33:34 salt systemd[1]: Unit autossh@eins-work.service entered failed state
Terkait: https://serverfault.com/a/563401/90324
Bagaimana mengkonfigurasi layanan systemd untuk selalu memulai kembali jika ada yang gagal?