-
-
Notifications
You must be signed in to change notification settings - Fork 105
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
os.environ['LOGNAME'] not defined #258
Comments
Simply export LOGNAME="XXX" can solve the issue.
So I suggest you use a script instead to wrap these things:
|
I did indeed define LOGNAME to work around this, but it was surprising behavior and took a little digging to figure out what was wrong, hence the bug report. |
Yup I know, I used your method to debug it too. But it should be a python
issue actually.
Quite happy to know that there's people doing exactly same thing ;)
|
Yeah, it turns out there are some... issues... with getting the original user. genie proper has to run setuid (via the setuid C executable and exec method) to function, but that means that getuid() isn't useful for getting it, and the normal method I'd use, os.getlogin(), requires that systemd-logind or an equivalent already be running to track login sessions before it can report anything, so that doesn't work either. LOGNAME wasn't my first choice, just the only one I had handy... and if not all distros set it by default (I'm a little surprised at Ubuntu dropping it), I'm not sure how I'm going to get that. Thoughts welcome? 😬 |
...and, naturally, the moment I bitch about the problem, I come up with a solution to said problem. Fix will be in 2.4. |
Windows version (build number):
22000.556
Linux distribution:
Ubuntu 22.04
Kernel version:
5.10.102.1-microsoft-standard-WSL2
Genie version:
genie 2.3
Describe the bug
I am trying to start genie when WSL boots using the new-ish boot command feature in wsl.conf. This fails because the LOGNAME environment variable has not been set yet:
Confirm that you are running inside the bottle:
N/A
To Reproduce
/etc/wsl.conf looks like this:
Run
wsl --shutdown
, restart it, then note that a)genie -r
reports "stopped", and b) the above stack is in the log file.The text was updated successfully, but these errors were encountered: