-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
xpra 4.3-r0-1 fails to launch when /etc/profile prints text #3401
Comments
sourcing Redirecting the output should be easy. I don't understand the second solution you are proposing. BTW, this causes an ugly backtrace in the server log, but the server does run fine:
|
I do not really know what you did there and why but it fails on my machine that prints text on login with the message you posted. Redirecting the output may be a good solution, when it works together with "source". I am not sure if people may have scripts in their profile file, that should only on login, though. |
I've just tried on bullseye and the problem with So, whatever is causing your server to fail to start, it isn't this feature. |
The fixes above will be included in 4.3.1 Feel free to re-open if I've missed something. |
I am not sure if it was fatal. I saw the backtrace and then built the workaround without too much debugging.
I'll do when I encounter the problem in the next Debian packages, but I assume it will work just fine now. |
I am still having the problem in the new release and see two other issues.
In my case the problems are only that a few calculations for pretty printing system stats are broken, but I could imagine more complicated profile scripts that may cause chaos when sources in a non-interactive shell. It looks like I cannot re-open the bug myself. |
Well, we try to find
May vs we know that not sourcing
Feel free to open a new one with suggestions for a better script to run, perhaps a distribution specific one? |
I see now what changed for the original bug and I am not sure how to handle the rest. Now I wonder, if either stderr should be hidden as well (allowing for a clean output) of if it is important to have in case a profile script breaks and then it's unclear why xpra behaves different from an interactive session. For my use-case the most interesting way would be if xpra could provide the environment of the interactive shell it is launched in to the subshell, so the output during the xpra login would look like an actual login. Another question is, if xpra cannot copy its own environment (I got the error when starting xpra from an interactive shell) when running the commands in the pipe. This would probably contain the environment variables needed for #3083 and similar use-cases, as |
I would rather show it somewhere so users will see if something breaks or is missing.
I don't understand this bit. For experimenting, you can just try a custom source script and dump the environment from there.
I'm not sure what this means either. Can you clarify?
I'm not aware of such an option in the ssh protocol. |
First: My use-case is mostly fixed. I'll probably ignore the breaking things until I've the time to add some checks if it's an interactive shell to the profile files. But I think in general the idea is that a profile script can assume it's an interactive shell.
Right. And in my case, where I show some system stats like free memory, it will be useful for xpra users.
That's what I said above. It can be useful in many cases to have the output of the profile script like it's run on an interactive login (here: system info), but it should probably come from an shell that behaves like a login-shell so scripts don't break. But this probably cannot work as, for example, a shell with piped output cannot calculate the terminal columns.
When I run Maybe
I guess I meant |
Why would they be missing? Is
Do you mean that those environment variables are not exposed to the sourced script? if env is None:
env = os.environ |
Hmm, interesting. I guess what I don't understand here is, why this isn't enough for the linked bug. You say:
And when it comes from this script, an interactive ssh session should have the variable set and I suppose the problem in the linked bug comes from running I wonder if it's something that Debian/Ubuntu should have set in When |
It wasn't me! I don't know.
I don't think it does. At least not the ones that matter here.
The problem with ssh logins is that they're not "proper" logins on some distributions (ie: Debian and derivatives) and therefore |
Not the ones that matter. Only some things like
I would need to test with a fresh installation. I think an interactive sessions gets these variables, but a command run via The JSON output doesn't break anymore, so I would think leaving it as is will be enough. |
Describe the bug
When /etc/profile produces output (like printing information about the host),
xpra start
fails.To Reproduce
Steps to reproduce the behavior:
echo test
to /etc/profilexpra start :10
System Information (please complete the following information):
Additional context
The server tries to run:
This fails because the output of
/etc/profile
is invalid json. This may even be a security issue, when someone injects valid json into the output of /etc/profile.A workaround is to remove sourcing /etc/profile. I guess it is sourced because it may set the python path, so the better solution is probably to redirect the output of sourcing the file or to better separate sourcing the
profile
script and running the command that dumps the environment.The text was updated successfully, but these errors were encountered: