diff --git a/examples/systemd/fips/teleport.service b/examples/systemd/fips/teleport.service index c366a249ed4d1..412b5f164c13e 100644 --- a/examples/systemd/fips/teleport.service +++ b/examples/systemd/fips/teleport.service @@ -5,6 +5,7 @@ After=network.target [Service] Type=simple Restart=on-failure +RestartSec=5 EnvironmentFile=-/etc/default/teleport ExecStart=/usr/local/bin/teleport start --fips --pid-file=/run/teleport.pid ExecReload=/bin/kill -HUP $MAINPID diff --git a/examples/systemd/production/auth/teleport.service b/examples/systemd/production/auth/teleport.service index db5c2109e11fd..646a3821bbcdb 100644 --- a/examples/systemd/production/auth/teleport.service +++ b/examples/systemd/production/auth/teleport.service @@ -5,6 +5,7 @@ After=network.target [Service] Type=simple Restart=on-failure +RestartSec=5 # Set the nodes roles with the `--roles` # In most production environments you will not # want to run all three roles on a single host diff --git a/examples/systemd/production/node/teleport.service b/examples/systemd/production/node/teleport.service index ca3e66dd2b564..707e7f6023f8b 100644 --- a/examples/systemd/production/node/teleport.service +++ b/examples/systemd/production/node/teleport.service @@ -5,6 +5,7 @@ After=network.target [Service] Type=simple Restart=on-failure +RestartSec=5 # Set the nodes roles with the `--roles` # In most production environments you will not # want to run all three roles on a single host diff --git a/examples/systemd/production/proxy/teleport.service b/examples/systemd/production/proxy/teleport.service index 7c64812aa52c6..362c73c469325 100644 --- a/examples/systemd/production/proxy/teleport.service +++ b/examples/systemd/production/proxy/teleport.service @@ -5,6 +5,7 @@ After=network.target [Service] Type=simple Restart=on-failure +RestartSec=5 # Set the nodes roles with the `--roles` # In most production environments you will not # want to run all three roles on a single host diff --git a/examples/systemd/teleport.service b/examples/systemd/teleport.service index b969f818b5c5a..515303d2e1677 100644 --- a/examples/systemd/teleport.service +++ b/examples/systemd/teleport.service @@ -5,6 +5,7 @@ After=network.target [Service] Type=simple Restart=on-failure +RestartSec=5 EnvironmentFile=-/etc/default/teleport ExecStart=/usr/local/bin/teleport start --pid-file=/run/teleport.pid ExecReload=/bin/kill -HUP $MAINPID diff --git a/lib/config/systemd.go b/lib/config/systemd.go index 7fc15080e9f69..ff7801d704b26 100644 --- a/lib/config/systemd.go +++ b/lib/config/systemd.go @@ -39,6 +39,7 @@ After=network.target [Service] Type=simple Restart=on-failure +RestartSec=5 EnvironmentFile=-{{ .EnvironmentFile }} ExecStart={{ .TeleportInstallationFile }} start --pid-file={{ .PIDFile }} ExecReload=/bin/kill -HUP $MAINPID diff --git a/lib/config/testdata/TestWriteSystemdUnitFile.golden b/lib/config/testdata/TestWriteSystemdUnitFile.golden index 7158564712cdc..4720caf4f10f5 100644 --- a/lib/config/testdata/TestWriteSystemdUnitFile.golden +++ b/lib/config/testdata/TestWriteSystemdUnitFile.golden @@ -5,6 +5,7 @@ After=network.target [Service] Type=simple Restart=on-failure +RestartSec=5 EnvironmentFile=-/custom/env/dir/teleport ExecStart=/custom/install/dir/teleport start --pid-file=/custom/pid/dir/teleport.pid ExecReload=/bin/kill -HUP $MAINPID