Documentation
¶
Overview ¶
Package proc holds small filesystem/process helpers shared by the start and stop commands: reading a PID file, liveness probing, and waiting for exit.
Liveness (Alive) and graceful stop (Terminate) are split across build tags — proc_unix.go uses signal semantics (signal 0 to probe, SIGTERM to stop), proc_windows.go uses the Win32 process API (OpenProcess/exit-code probe, TerminateProcess) — because os.Process.Signal on native Windows supports ONLY Kill and rejects both signal-0 and SIGTERM (OPS-20). Without the split, a local (non-Docker) install on Windows would see a live app reported as dead (Alive→false clears the PID file) or a failed SIGTERM out of `jenticctl stop`.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Alive ¶
Alive reports whether the process is currently running. The probe is platform-specific (see aliveImpl in proc_unix.go / proc_windows.go): a signal-0 send on Unix, an OpenProcess + exit-code check on Windows.
func FileExists ¶
FileExists reports whether path exists and is a regular file.
func LivePID ¶
LivePID reads the PID file at path and reports the recorded process id and whether that process is currently running. A missing PID file yields (0, false, nil); only a malformed/unreadable file returns an error. A present file whose process has exited yields (pid, false, nil) — a stale PID file.
func ReadPIDFile ¶
ReadPIDFile reads and parses the PID stored at path.
func Terminate ¶ added in v0.32.0
Terminate requests a graceful stop of the process, returning any error from the platform stop primitive. On Unix it sends SIGTERM (the process can run its shutdown handlers); on Windows — where os.Process.Signal accepts only Kill — it falls back to a hard TerminateProcess via p.Kill(), since there is no portable graceful-signal equivalent (OPS-20). Callers still escalate to Kill after a timeout via the existing stop flow.
Types ¶
This section is empty.