Commit Graph

15 Commits

Author SHA1 Message Date
Tim Hockin 9241b1061f
Exercise the git "dubious ownership" path
To do this, we run the e2e test as a different user.  To do that, we
need git-sync to make sure that everything is group accessible.  To
clean up after the test, we need everything to be group writable.  To do
that, we add a new flag: `--group-write`.
2023-03-17 15:51:25 -07:00
Tim Hockin 2f1720cdaf
Log commands we run with original caller 2023-02-10 14:59:45 -08:00
Tim Hockin 812da0c43e Pass the whole environment to exechooks 2022-05-16 18:07:46 -07:00
Tim Hockin d953c0bf59 TrimSpace exec's stdout/stderr for log 2022-03-17 12:06:52 -07:00
Tim Hockin 32e0d53b33 Set $GITSYNC_HASH in exechook 2022-02-06 16:26:04 -08:00
Tim Hockin cbf8b896a3 Don't double-register the hook metric 2022-01-22 14:25:24 -08:00
Tim Hockin 89b0bd5448 Ensure web/exec hooks complete in --one-time
Also some small e2e cleanups.  This is a port from master branch.
2022-01-19 12:01:15 -08:00
Tim Hockin 44306c0dd8 Rename exechook receivers 2021-08-16 23:45:48 -07:00
Tim Hockin 2d3ccf6026 Add one call depth to compensate for log pkg 2021-08-16 23:43:47 -07:00
ugurkenar df69fab365 cmd,hook and logging package 2021-08-16 12:40:27 +03:00
Tim Hockin 4765eb5b14 Make sure all code files have headers 2021-05-27 08:45:36 -07:00
Tim Hockin 11c2a1fd7b Fix exit non-zero exit codes when running as pid1
Prior to this we would swallow the exit code and always exit(0).
2021-03-15 09:30:46 -07:00
Tim Hockin 95a1690e6f Fix 2 bugs in pid1
1) Was calling Wait() on the child process, but also calling Wait4,
which would race, causing an occasional error or panic.

2) In testing (1), I observed occasional hangs.  Tracing it down to a
SIGWINCH, which masked a SIGCHLD, causing it to hang.  Both seem fixed.

Added a manual test script.
2020-03-20 13:44:27 -07:00
Tim Hockin 2a42fba009 Handle running as pid 1
This detects when it is running as pid 1, and becomes an init process.
Specifically this means handling SIGCHLD and reaping processes
(otherwise they become zombies) and forwarding signals to "real"
process.

We fork and re-exec ourselves so that we only get *this* SIGCHLD for
orphaned processes (re-parented to 1) and not the real events from
running things like git or ssh.
2019-10-27 09:45:27 -07:00
Tim Hockin 70feeb5ae1 Use the go-build-template
Faster builds and versions from tags.  Also use alpine as a base image.  We
need alpine for other architectures...

Also change the --wait flag to take a float for sub-second waits.
2016-10-30 17:09:06 -07:00