fix different PID not loading environment that go wrong#105
fix different PID not loading environment that go wrong#105dustccc wants to merge 2 commits intoProject-HAMi:mainfrom
Conversation
|
Welcome @dustccc! It looks like this is your first PR to Project-HAMi/HAMi-core 🎉 |
Signed-off-by: dust <2476550578@qq.com>
chaunceyjiang
left a comment
There was a problem hiding this comment.
I noticed that you used SSH for testing.
As far as I know, due to security reasons, sshd does not inherit environment variables (ENV) by default. However, you can configure sshd to inherit ENV, so that when you log in via SSH, the environment variables will be correctly loaded.
This is also for security reasons, but I've noticed that many issues in Project-HAMi mention inaccurate graphics card information when different users or different methods use containers for training, and component errors may occur. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dustccc The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
for information, peek at this issue.
When new PID born, container can't read its env by default, so the show info go wrong.
I changed the part that get the env vars from PID 1. If there is no such env, just return and go next step; if exists then read it and use the injected default env vars. After thinking, i not pick single env var to load, cuz later code maybe add new env var.