Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Unit files and an example config are in [`deploy/`](deploy/).
- To stop the run without failing it, a stage can write
`{"decision":"blocked","summary":"…","needs":["…"]}` to `$STAGEHAND_RESULT`.
- **What a shell stage sees:**
- `PATH`, `HOME`, `LANG` and `TZ` from the runner;
- `PATH`, `HOME` and `TZ` from the runner (each only if the runner has it), and `LANG=C.UTF-8`;
- `STAGEHAND_PIPELINE`, `STAGEHAND_RUN_ID`, `STAGEHAND_STAGE`, `STAGEHAND_ATTEMPT`;
- `STAGEHAND_WORK`, the run's shared work directory, where stages pass files to each other;
- `STAGEHAND_RESULT`;
Expand Down Expand Up @@ -442,6 +442,7 @@ After=network-online.target
Wants=network-online.target

[Service]
Environment=HOME=/root
ExecStart=/usr/local/bin/stagehand --home /var/lib/stagehand serve --status-addr 127.0.0.1:8795
Restart=on-failure
KillMode=control-group
Expand All @@ -455,6 +456,9 @@ WantedBy=multi-user.target
`interrupted`, so they can be resumed later.
- **Crashes:** `KillMode=control-group` makes systemd kill any stage processes left behind if the
runner crashes.
- **`HOME`:** systemd sets no `HOME` for a root service without `User=`, and stages get the
runner's `HOME` (or none). Set it, as above, if stages run tools that keep credentials there
(omp, herdr, gh); otherwise they work under `stagehand run` but fail under `serve`.

### Upgrading and rolling back

Expand Down
3 changes: 3 additions & 0 deletions deploy/stagehand.service
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Wants=network-online.target stagehand-hetzner2-tunnel.service stagehand-gateway-
[Service]
Type=simple
Environment=STAGEHAND_HOME=/var/lib/stagehand
# systemd sets no HOME for a root service without User=; shell stages inherit
# this one (tools such as omp, herdr and gh find their credentials through it).
Environment=HOME=/root
Environment=STAGEHAND_CONFIG=/etc/stagehand/config.yaml
# --trigger-addr: event intake (loopback only; needs events.secret_file in the config).
ExecStart=/usr/local/bin/stagehand serve --status-addr 127.0.0.1:8797 --trigger-addr 127.0.0.1:8798
Expand Down
Loading