Commit Graph
6 Commits
Author SHA1 Message Date
Jakub NyckowskiandZac Bergquist b4e1d5d7ae Set OOM score to 0 for child processes (#19383)
* Set OOM score to 0 for child processes

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2022-12-20 02:50:27 +00:00
Edoardo Spadolini 521d6c299f Simplify reexec on linux (#13106)
* Simplify reexec on linux

The previous handling that kept a file descriptor open was designed to
keep working even after the qemu-user bug that made us add the
workaround was fixed; however, that breaks reexec with changed
credentials, so now we just use /proc/self/exe if we detect that we're
not being affected by the qemu-user bug.

* Clarify comments
2022-06-02 18:56:35 +00:00
Edoardo Spadolini 4384c354ff Reexec with /proc/self/exe on Linux (#11283)
* Reexec with `/proc/self/exe` on Linux

* Add a check for qemu-user

* Add comment
2022-03-25 10:16:43 +00:00
Zac Bergquist 0bae0d255f Cleanup lint targets
- Don't assume an explicit $GOPATH is set
- Remove golint from linters - it's been deprecated for over a year
  and golangci-lint prints a warning instead of running it.
2021-10-19 09:21:55 -06:00
Alan Parra dba49bfad6 Lint and fix missing license headers (#8075)
Introduce new make targets to check and add license headers to files
("make lint-license" and "make fix-license"). License checking is now a part of
"make lint" as well.

Initial attempts used goheader, but it caused "make lint-go" to become about 9x
slower (if not more), plus it only targets go files. Google's addlicense is fast
enough and targets however many file types we want.

Existing files that were missing licenses got the header added, using the
current year as the license date.

* Introduce lint-license and fix-license make targets
* Ignore generated files
* Add license to go files
* Replace irregular licenses with standard copyright/license
* Add license to proto files
* Install addlicense in build.assets Dockerfile
2021-08-30 09:44:09 -07:00
Andrew Lytvynov 12952b4904 Set PDEATHSIG to SIGKILL on child processes after reexec
To execute an SSH command, Teleport re-executes itself and execs the
command from this child process:
  teleport -> teleport exec -> sh -c "user command"

Both parent teleport processes could exit unexpectedly (from SIGKILL or
even connection interruption).

Make sure all child processes get cleaned up and not orphaned to PID 1:
- teleport exec via SIGQUIT to request graceful shutdown
- user command via SIGKILL because it might ignore other signals
2020-04-16 16:56:22 +00:00