Skip to content

systemd ready-gate: HTTP(S) HEALTHCHECK not converted to curl (raw URL passed to bash) #46

Description

@adiled

Deviation: HEALTHCHECK with an HTTP(S) URL is legal per the grammar (HEALTHCHECK ws ( url | command_string ), and SPEC.md "Starts with http:// or https:// → HTTP check"), but the systemd ready-gate passes the raw URL into bash instead of converting it to a curl poll.

src/orchdi.rs::healthcheck_to_cmd() correctly maps http(s)://... → curl -sf '...', and that is used by build_dep_gates() which feeds the launchd and orchdi supervisors.

But systemd generate_ready_gate() (src/platform/systemd/generate.rs) uses service.healthcheck verbatim:

let healthcheck = service.healthcheck.as_deref().unwrap_or("true");
...
"ExecStart=/bin/bash -c 'until {} >/dev/null 2>&1; do sleep 2; done'",

So HEALTHCHECK http://localhost:8000/health renders an invalid bash command (http://localhost/... is not a valid command) — the gate never succeeds and blocks dependents.

Fix: apply healthcheck_to_cmd (or the equivalent curl conversion) in the systemd ready-gate path, matching launchd/orchdi.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions