Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

lxdock shell -c does not use login environment and sets incorrect SHELL #147

Open
shuhaowu opened this issue May 22, 2018 · 2 comments
Open

Comments

@shuhaowu
Copy link
Contributor

shuhaowu commented May 22, 2018

When executing a command via lxdock shell -c, it is not providing an environment similar to as if user logged in directly. This is because we are using su -l <user> -s, then passing a file that has #!/bin/sh. This overrides the login environment as we're now in the hands of /bin/sh.

To fix this, we can probably use #!/bin/sh -l, although we might encounter compatibility issues if people's profile are only compatible with bash and equivalent and sh is something like dash.

Also, $SHELL is set to the script that we create, which is problematic for programs that detect $SHELL

@shuhaowu shuhaowu changed the title lxdock shell -c does not use login environment lxdock shell -c does not use login environment and sets incorrect SHELL May 22, 2018
@robvdl robvdl mentioned this issue May 29, 2018
9 tasks
@robvdl
Copy link
Member

robvdl commented Feb 23, 2020

We set SHELL now, not sure if anything else needs to be done. Surely there must be more login environment variables we're still missing.

@mtausig
Copy link
Contributor

mtausig commented Feb 28, 2020

@shuhaowu Do you have an example script which previously failed, to validate if #173 was enough to close this issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants