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

Read from shell environment variable if exists #403

Merged
merged 4 commits into from
Apr 24, 2024

Conversation

casassg
Copy link
Contributor

@casassg casassg commented Apr 16, 2024

This solves an issue when hermit is activated by non interactive bash scripts (as it happens in Slurm for example) and when the /etc/passwd is not populated as its dynamically set by some system daemon (example: OS Login in GCP).

This leads to the following error:

fatal:hermit: /etc/passwd file entry for "gerardc_squareup_com" is missing

SHELL should be populated automatically by login on all unix systems (which gets set by reading from passwd database or by checking the default). So we can just use it to set it.

@alecthomas
Copy link
Collaborator

I don't think this is going to solve your problem. I believe that error is a result of calling user.Current(), and we use that in many other locations in Hermit.

@casassg
Copy link
Contributor Author

casassg commented Apr 17, 2024

I don't think this is going to solve your problem. I believe that error is a result of calling user.Current(), and we use that in many other locations in Hermit.

nope, user.Current() is correct (see the trace printing gerardc_squareup_com which is indeed the correct user).

Copy link
Collaborator

@alecthomas alecthomas left a comment

Choose a reason for hiding this comment

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

Can you put this below the ppid check please.

@casassg
Copy link
Contributor Author

casassg commented Apr 17, 2024

sure thing!

@casassg
Copy link
Contributor Author

casassg commented Apr 24, 2024

@alecthomas could this be merged and deployed?

@alecthomas alecthomas merged commit f62cbde into cashapp:master Apr 24, 2024
6 checks passed
spicykay pushed a commit to spicykay/hermit that referenced this pull request Aug 23, 2024
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.

2 participants