Skip to content

Clean up coder agent ps listing in workspace #2407

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

Closed
mafredri opened this issue Jun 16, 2022 · 0 comments · Fixed by #2453
Closed

Clean up coder agent ps listing in workspace #2407

mafredri opened this issue Jun 16, 2022 · 0 comments · Fixed by #2453
Assignees
Labels
api Area: HTTP API

Comments

@mafredri
Copy link
Member

Currently when viewing the process listing in a workspace, the user would see something like this:

coder@work:~$ ps aux | grep '[c]oder agent'
coder          1  0.4  0.0 745848 43092 ?        Ssl  14:24   0:00 /tmp/tmp.coderwWs87Y/coder agent

This doesn't look very neat and the tmp path is a bit weird, I'd rather this looked like this:

coder@work:~$ ps aux | grep '[c]oder agent'
coder          1  0.4  0.0 745848 43092 ?        Ssl  14:24   0:00 coder agent

We can achieve this by updating the agent startup scripts with a cd /tmp/tmp.coderwWs87Y; exec coder agent ....

While we're at it, we could change the tmp path from: /tmp/tmp.coderwWs87Y to /tmp/coder.wWs87Y which looks neater in my opinion.

@mafredri mafredri added feature api Area: HTTP API labels Jun 16, 2022
@mafredri mafredri self-assigned this Jun 17, 2022
mafredri added a commit that referenced this issue Jun 17, 2022
This commit changes the `coder agent` path in `ps` listing from
`/tmp/tmp.coderwWs87Y/coder agent` to `./coder agent`.

The path is also updated to `/tmp/coder.wWs87Y`.

There were two options considered for turning `./coder agent` into
`coder agent`:

1. Run `exec -a coder /path/to/coder agent`
2. Run `PATH=/path/to:$PATH exec coder agent`

Option 1 is not supported by `dash`, and thus discarded.

Option 2 duplicates functionality in `coder agent` which _appends_ the
path, here we would want to _prepend_ it to ensure we're starting the
downloaded `coder` binary in case there is a binary with a conflicting
name on the system.

Fixes #2407
mafredri added a commit that referenced this issue Jun 17, 2022
This commit changes the `coder agent` path in `ps` listing from
`/tmp/tmp.coderwWs87Y/coder agent` to `./coder agent`.

The path is also updated to `/tmp/coder.wWs87Y`.

There were two options considered for turning `./coder agent` into
`coder agent`:

1. Run `exec -a coder /path/to/coder agent`
2. Run `PATH=/path/to:$PATH exec coder agent`

Option 1 is not supported by `dash`, and thus discarded.

Option 2 duplicates functionality in `coder agent` which _appends_ the
path, here we would want to _prepend_ it to ensure we're starting the
downloaded `coder` binary in case there is a binary with a conflicting
name on the system.

Fixes #2407
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Area: HTTP API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant