diff --git a/examples/systemd/fips/teleport.service b/examples/systemd/fips/teleport.service index 7a0cb36770421..acf39091e687f 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 --config /etc/teleport.yaml --fips --pid-file=/run/teleport.pid # systemd before 239 needs an absolute path diff --git a/examples/systemd/production/auth/teleport.service b/examples/systemd/production/auth/teleport.service index 94e5a7887a122..b38dbadbdfeae 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 82f1ebc26f12c..aa9795267f220 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 2a0a191d513f2..0a68389db2b10 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 d641fb2f13287..9f63664173c89 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 --config /etc/teleport.yaml --pid-file=/run/teleport.pid # systemd before 239 needs an absolute path diff --git a/lib/config/systemd.go b/lib/config/systemd.go index 5992b119c2cb5..d47bd25647921 100644 --- a/lib/config/systemd.go +++ b/lib/config/systemd.go @@ -45,6 +45,7 @@ After=network.target [Service] Type=simple Restart=on-failure +RestartSec=5 EnvironmentFile=-{{ .EnvironmentFile }} ExecStart={{ .TeleportInstallationFile }} start --config {{ .TeleportConfigPath }} --pid-file={{ .PIDFile }} # systemd before 239 needs an absolute path diff --git a/lib/config/testdata/TestWriteSystemdUnitFile.golden b/lib/config/testdata/TestWriteSystemdUnitFile.golden index b852e9399ee28..1c219171700db 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 --config /etc/teleport.yaml --pid-file=/custom/pid/dir/teleport.pid # systemd before 239 needs an absolute path