diff --git a/assets/aws/files/system/teleport-acm.service b/assets/aws/files/system/teleport-acm.service index 91d7e1a84fa5d..6dcab6c09d70b 100644 --- a/assets/aws/files/system/teleport-acm.service +++ b/assets/aws/files/system/teleport-acm.service @@ -11,6 +11,7 @@ Restart=always RestartSec=5 RuntimeDirectory=teleport ExecStart=/usr/local/bin/teleport start --config=/etc/teleport.yaml --diag-addr=127.0.0.1:3000 --pid-file=/run/teleport/teleport.pid -ExecReload=pkill -HUP -L -F /run/teleport/teleport.pid +# systemd before 239 needs an absolute path +ExecReload=/bin/sh -c "exec pkill -HUP -L -F /run/teleport/teleport.pid" PIDFile=/run/teleport/teleport.pid LimitNOFILE=524288 diff --git a/assets/aws/files/system/teleport-auth.service b/assets/aws/files/system/teleport-auth.service index f1b99b9879a0d..9cd5c39e05f89 100644 --- a/assets/aws/files/system/teleport-auth.service +++ b/assets/aws/files/system/teleport-auth.service @@ -11,7 +11,8 @@ Restart=always RestartSec=5 RuntimeDirectory=teleport ExecStart=/usr/local/bin/teleport start --config=/etc/teleport.yaml --diag-addr=127.0.0.1:3000 --pid-file=/run/teleport/teleport.pid -ExecReload=pkill -HUP -L -F /run/teleport/teleport.pid +# systemd before 239 needs an absolute path +ExecReload=/bin/sh -c "exec pkill -HUP -L -F /run/teleport/teleport.pid" PIDFile=/run/teleport/teleport.pid LimitNOFILE=524288 diff --git a/assets/aws/files/system/teleport-node.service b/assets/aws/files/system/teleport-node.service index b0b26651ac970..32107a77b7428 100644 --- a/assets/aws/files/system/teleport-node.service +++ b/assets/aws/files/system/teleport-node.service @@ -12,7 +12,8 @@ RestartSec=5 RuntimeDirectory=teleport ExecStartPre=/usr/local/bin/teleport-ssm-get-token ExecStart=/usr/local/bin/teleport start --config=/etc/teleport.yaml --diag-addr=127.0.0.1:3000 --pid-file=/run/teleport/teleport.pid -ExecReload=pkill -HUP -L -F /run/teleport/teleport.pid +# systemd before 239 needs an absolute path +ExecReload=/bin/sh -c "exec pkill -HUP -L -F /run/teleport/teleport.pid" PIDFile=/run/teleport/teleport.pid LimitNOFILE=524288 diff --git a/assets/aws/files/system/teleport-proxy-acm.service b/assets/aws/files/system/teleport-proxy-acm.service index e711afb8fc663..260b914841746 100644 --- a/assets/aws/files/system/teleport-proxy-acm.service +++ b/assets/aws/files/system/teleport-proxy-acm.service @@ -13,7 +13,8 @@ RuntimeDirectory=teleport EnvironmentFile=/etc/teleport.d/conf ExecStartPre=/usr/local/bin/teleport-ssm-get-token ExecStart=/usr/local/bin/teleport start --config=/etc/teleport.yaml --diag-addr=127.0.0.1:3000 --pid-file=/run/teleport/teleport.pid -ExecReload=pkill -HUP -L -F /run/teleport/teleport.pid +# systemd before 239 needs an absolute path +ExecReload=/bin/sh -c "exec pkill -HUP -L -F /run/teleport/teleport.pid" PIDFile=/run/teleport/teleport.pid LimitNOFILE=524288 diff --git a/assets/aws/files/system/teleport-proxy.service b/assets/aws/files/system/teleport-proxy.service index 4d6f729bfc7d6..5f88872d07bbe 100644 --- a/assets/aws/files/system/teleport-proxy.service +++ b/assets/aws/files/system/teleport-proxy.service @@ -14,7 +14,8 @@ EnvironmentFile=/etc/teleport.d/conf ExecStartPre=/usr/local/bin/teleport-ssm-get-token ExecStartPre=/bin/aws s3 sync s3://${TELEPORT_S3_BUCKET}/live/${TELEPORT_DOMAIN_NAME} /var/lib/teleport ExecStart=/usr/local/bin/teleport start --config=/etc/teleport.yaml --diag-addr=127.0.0.1:3000 --pid-file=/run/teleport/teleport.pid -ExecReload=pkill -HUP -L -F /run/teleport/teleport.pid +# systemd before 239 needs an absolute path +ExecReload=/bin/sh -c "exec pkill -HUP -L -F /run/teleport/teleport.pid" PIDFile=/run/teleport/teleport.pid LimitNOFILE=524288 diff --git a/assets/aws/files/system/teleport.service b/assets/aws/files/system/teleport.service index 5e6a091f75d47..73e7fce096891 100644 --- a/assets/aws/files/system/teleport.service +++ b/assets/aws/files/system/teleport.service @@ -12,7 +12,8 @@ RestartSec=5 RuntimeDirectory=teleport ExecStartPre=/usr/local/bin/teleport-all-pre-start ExecStart=/usr/local/bin/teleport start --config=/etc/teleport.yaml --diag-addr=127.0.0.1:3000 --pid-file=/run/teleport/teleport.pid -ExecReload=pkill -HUP -L -F /run/teleport/teleport.pid +# systemd before 239 needs an absolute path +ExecReload=/bin/sh -c "exec pkill -HUP -L -F /run/teleport/teleport.pid" PIDFile=/run/teleport/teleport.pid LimitNOFILE=524288 diff --git a/examples/systemd/fips/teleport.service b/examples/systemd/fips/teleport.service index a87df21500486..7a0cb36770421 100644 --- a/examples/systemd/fips/teleport.service +++ b/examples/systemd/fips/teleport.service @@ -7,7 +7,8 @@ Type=simple Restart=on-failure EnvironmentFile=-/etc/default/teleport ExecStart=/usr/local/bin/teleport start --config /etc/teleport.yaml --fips --pid-file=/run/teleport.pid -ExecReload=pkill -HUP -L -F /run/teleport.pid +# systemd before 239 needs an absolute path +ExecReload=/bin/sh -c "exec pkill -HUP -L -F /run/teleport.pid" PIDFile=/run/teleport.pid LimitNOFILE=524288 diff --git a/examples/systemd/production/auth/teleport.service b/examples/systemd/production/auth/teleport.service index 51309784e2372..94e5a7887a122 100644 --- a/examples/systemd/production/auth/teleport.service +++ b/examples/systemd/production/auth/teleport.service @@ -11,7 +11,8 @@ Restart=on-failure # --roles='proxy,auth,node' is the default value # if none is set ExecStart=/usr/local/bin/teleport start --roles=auth --config=/etc/teleport.yaml --diag-addr=127.0.0.1:3000 --pid-file=/run/teleport.pid -ExecReload=pkill -HUP -L -F /run/teleport.pid +# systemd before 239 needs an absolute path +ExecReload=/bin/sh -c "exec pkill -HUP -L -F /run/teleport.pid" PIDFile=/run/teleport.pid LimitNOFILE=524288 diff --git a/examples/systemd/production/node/teleport.service b/examples/systemd/production/node/teleport.service index 0845c6c05ec8d..82f1ebc26f12c 100644 --- a/examples/systemd/production/node/teleport.service +++ b/examples/systemd/production/node/teleport.service @@ -11,7 +11,8 @@ Restart=on-failure # --roles='proxy,auth,node' is the default value # if none is set ExecStart=/usr/local/bin/teleport start --roles=node --config=/etc/teleport.yaml --pid-file=/run/teleport.pid -ExecReload=pkill -HUP -L -F /run/teleport.pid +# systemd before 239 needs an absolute path +ExecReload=/bin/sh -c "exec pkill -HUP -L -F /run/teleport.pid" PIDFile=/run/teleport.pid LimitNOFILE=524288 diff --git a/examples/systemd/production/proxy/teleport.service b/examples/systemd/production/proxy/teleport.service index 029785694a49e..2a0a191d513f2 100644 --- a/examples/systemd/production/proxy/teleport.service +++ b/examples/systemd/production/proxy/teleport.service @@ -11,7 +11,8 @@ Restart=on-failure # --roles='proxy,auth,node' is the default value # if none is set ExecStart=/usr/local/bin/teleport start --roles=proxy --config=/etc/teleport.yaml --pid-file=/run/teleport.pid -ExecReload=pkill -HUP -L -F /run/teleport.pid +# systemd before 239 needs an absolute path +ExecReload=/bin/sh -c "exec pkill -HUP -L -F /run/teleport.pid" PIDFile=/run/teleport.pid LimitNOFILE=524288 diff --git a/examples/systemd/teleport.service b/examples/systemd/teleport.service index b5d71b1e1de31..d641fb2f13287 100644 --- a/examples/systemd/teleport.service +++ b/examples/systemd/teleport.service @@ -7,6 +7,7 @@ Type=simple Restart=on-failure 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 ExecReload=/bin/sh -c "exec pkill -HUP -L -F /run/teleport.pid" PIDFile=/run/teleport.pid LimitNOFILE=524288 diff --git a/lib/config/systemd.go b/lib/config/systemd.go index 6146b89926752..5992b119c2cb5 100644 --- a/lib/config/systemd.go +++ b/lib/config/systemd.go @@ -47,7 +47,8 @@ Type=simple Restart=on-failure EnvironmentFile=-{{ .EnvironmentFile }} ExecStart={{ .TeleportInstallationFile }} start --config {{ .TeleportConfigPath }} --pid-file={{ .PIDFile }} -ExecReload=pkill -HUP -L -F "{{ .PIDFile }}" +# systemd before 239 needs an absolute path +ExecReload=/bin/sh -c "exec pkill -HUP -L -F {{ .PIDFile }}" PIDFile={{ .PIDFile }} LimitNOFILE={{ .FileDescriptorLimit }} diff --git a/lib/config/testdata/TestWriteSystemdUnitFile.golden b/lib/config/testdata/TestWriteSystemdUnitFile.golden index 8153d3270b129..b852e9399ee28 100644 --- a/lib/config/testdata/TestWriteSystemdUnitFile.golden +++ b/lib/config/testdata/TestWriteSystemdUnitFile.golden @@ -7,7 +7,8 @@ Type=simple Restart=on-failure EnvironmentFile=-/custom/env/dir/teleport ExecStart=/custom/install/dir/teleport start --config /etc/teleport.yaml --pid-file=/custom/pid/dir/teleport.pid -ExecReload=pkill -HUP -L -F "/custom/pid/dir/teleport.pid" +# systemd before 239 needs an absolute path +ExecReload=/bin/sh -c "exec pkill -HUP -L -F /custom/pid/dir/teleport.pid" PIDFile=/custom/pid/dir/teleport.pid LimitNOFILE=16384