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

Add a fallback for ps in remoteProcessPickerScript #5207

Merged
merged 3 commits into from
May 16, 2022

Conversation

ssaraswati
Copy link
Contributor

Addresses #4096 by providing a fallback to ps when ps is not available or when ps doesn't support all options.

This solves connecting to Alpine hosts that don't support the flags output option and Ubuntu docker images that don't have ps installed by default.

@dnfadmin
Copy link

dnfadmin commented May 13, 2022

CLA assistant check
All CLA requirements met.

Comment on lines 15 to 28
command=`awk '{print $2}' /proc/$pid/stat | tr -d '()'`
args=`xargs -0 < /proc/$pid/cmdline | awk '{print $2}'`;
printf "%5s %.1s %-49s %-27s \n\r" $pid $flags $command $args
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add comments for what each of these lines is accomplishing. I am not an expert with linux utils and it would be helpful when referencing it in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for feedback, I have updated it with explanation of each line

@JoeRobich
Copy link
Member

This seems similar to a script that VS Code ships with - https://github.com/microsoft/vscode/blob/main/src/vs/base/node/ps.sh

@ssaraswati ssaraswati force-pushed the feature/no-ps-remote-picker branch from 981023f to c40f0bc Compare May 13, 2022 21:26
@ssaraswati
Copy link
Contributor Author

This seems similar to a script that VS Code ships with - https://github.com/microsoft/vscode/blob/main/src/vs/base/node/ps.sh

Yes very similar from the looks of it, only difference being the columns its outputting really, I am not familiar with vs code extension development, would it be possible to use their script instead of maintaining this?

Copy link
Member

@JoeRobich JoeRobich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@JoeRobich
Copy link
Member

would it be possible to use their script instead of maintaining this?

It doesn't appear that they expose this as an API and I don't think we would have access to it.

@JoeRobich JoeRobich merged commit f66e2d6 into dotnet:master May 16, 2022
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

Successfully merging this pull request may close these issues.

None yet

3 participants