"Something is listening on 8100. Cute. But is it Ember — or a ghost wearing Ember's port?"
The Trap in a Green Light
Here's the naive health check: connect to the declared port, and if something answers, call it 'running.' It feels reasonable and it's quietly wrong. A TCP listener only proves that some process is bound to that port — not that it's the product you expect. It could be a leftover server from last week that never got killed. It could be a different app that grabbed the port first. It could be a placeholder, a proxy, a totally unrelated process. Every one of those makes the naive check show a confident green light for a service that is, in truth, not there.
Two Checks That Prove Identity
Firelink refuses to be fooled, so it verifies responder identity with two checks. First, the port-owner check: for an office launchd member, the declared localhost port must be owned by the job's own process tree — not merely open, but held by the process the launchd job actually spawned. Second, the health-identity check: a member with a declared health path must answer that path with the expected identity substring — the response has to say, in effect, 'yes, I'm Ember.' Pass both and it's genuinely running. Fail either one and Firelink reports unknown with the mismatch detail — never running.
Why 'Unknown' Is the Honest Verdict
Notice it doesn't report 'stopped' on a failed identity check either. Something is answering — it's just not provably the right something. That's not 'down'; it's 'I can't confirm this is what it claims to be.' Calling it running would be a lie; calling it stopped would also be a lie. unknown, plus the specific mismatch, is the only honest answer — and it's exactly the state a human needs to see to go investigate 'what is actually sitting on that port?'