unit
unit copied to clipboard
CLI: instances listening on TCP ports are shown as unix sockets
Very minor visual nitpick: when the control socket is bound to a TCP port it is labelled as a unix socket.
$ unitctl instances
unitd instance [pid: 10517, version: 1.32.1]:
Executable: /opt/homebrew/bin/unitd
Process working directory: /private/var/folders/f4/zhdby6p90115nc7hdg8x031h0000gp/T/tmp.h5LeycqaHr
Process ownership: name: d.deleo, uid: 502, gid: 20
Process effective ownership: name: d.deleo, uid: 502, gid: 20
API control unix socket: unix:/opt/homebrew/var/run/unit/control.sock
Child processes ids: 10517, 10517
Runtime flags: [unknown]
Configure options: --prefix=/opt/homebrew/Cellar/unit/1.32.1 --sbindir=/opt/homebrew/Cellar/unit/1.32.1/bin --logdir=/opt/homebrew/var/log --log=/opt/homebrew/var/log/unit/unit.log --runstatedir=/opt/homebrew/var/run --pid=/opt/homebrew/var/run/unit/unit.pid --control=unix:/opt/homebrew/var/run/unit/control.sock --modules=/opt/homebrew/lib/unit/modules --statedir=/opt/homebrew/var/state/unit --tmpdir=/tmp --openssl --njs --cc-opt=-I/opt/homebrew/opt/openssl@3/include --ld-opt=-L/opt/homebrew/opt/openssl@3/lib
unit:minimal (docker) instance [pid: 6074, version: 1.32.1]:
Executable: unit:minimal (docker)
Process working directory: <container>:
Process ownership: [unknown]
Process effective ownership: [unknown]
API control unix socket: 127.0.0.1:8001 <------- this thing
Child processes ids:
Runtime flags: --no-daemon --control 127.0.0.1:8001
Configure options: [unknown]
Container:
Platform: Docker
Container ID: 5f4db8ea3b33a38d78d8d0cc1d60f2b258c2acdaa272d36570275986ecbfd772
Mounts:
/www => /host_mnt/private/var/folders/f4/zhdby6p90115nc7hdg8x031h0000gp/T/tmp.h5LeycqaHr
The structured JSON output is similar:
$ unitctl instances -t json | jq
<...>
"version": "1.32.1",
"control_socket": "127.0.0.1:8001",
"log_path": null,
"pid_path": null,
"modules_directory": null,
"state_directory": null,
"tmp_directory": null,
"runtime_flags": "--no-daemon --control 127.0.0.1:8001",
<...>