Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: instances listening on TCP ports are shown as unix sockets #1266

Open
Tracked by #1276
danielledeleo opened this issue May 15, 2024 · 2 comments
Open
Tracked by #1276

CLI: instances listening on TCP ports are shown as unix sockets #1266

danielledeleo opened this issue May 15, 2024 · 2 comments

Comments

@danielledeleo
Copy link
Contributor

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",
<...>
@ac000
Copy link
Member

ac000 commented Jul 26, 2024

I think you can simply drop the word "unix". So it's simply

API control socket

The json looks ok to me.

@lcrilly
Copy link
Contributor

lcrilly commented Jul 26, 2024

The documentation refers to this simply as "control socket"

https://unit.nginx.org/controlapi/#api-manipulation

So I would also drop "API". Which also seems consistent with unitctl --help

$ unitctl --help | grep socket
  -s, --control-socket-address <CONTROL_SOCKET_ADDRESSES>
          Number of seconds to wait for control socket to become available
          Number of times to try to access control socket when waiting [default: 3]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants