Repository navigation
Retain the PS1 across su(1) and sudo(8) - #148
Merged
Merged
Conversation
Member
Author
|
To test, ensure that you have Then, use |
Commit 97f4e07 made /etc/profile.d/toolbox.sh available inside the toolbox container through a bind mount. However, it only works for for toolbox containers created after that commit. Older containers don't have the bind mount. A subsequent commit will switch to using the /etc/profile.d/toolbox.sh start-up script to set the PS1 instead of doing it as part of the 'podman exec' invocation. It's necessary to ensure that the start-up script is available on older containers to avoid breaking the PS1 when entering them. https://github.com/debarshiray/toolbox/pull/148
debarshiray
force-pushed
the
wip/rishi/set-ps1-in-profile.d-toolbox
branch
from
May 3, 2019 18:14
9fb4a23 to
05732e1
Compare
debarshiray
referenced
this pull request
May 3, 2019
This is better than using an environment variable like TOOLBOX_CONTAINER because it can't be unset by commands like su(1) or sudo(8). One nice side-effect of doing it inside 'toolbox enter' is that it will automatically work with older toolbox containers. A subsequent commit will switch to using the /etc/profile.d/toolbox.sh start-up script to set the PS1 instead of doing it as part of the 'podman exec' invocation. Having the identification mechanism work with older toolbox containers is important to avoid breaking the PS1 for backwards compatibility. https://github.com/debarshiray/toolbox/pull/148
debarshiray
referenced
this pull request
May 3, 2019
The shell start-up scripts are where the PS1 is meant to be set. So far, the absence of a toolbox-specific start-up script was being worked around by setting the PS1 as part of the 'podman exec' invocation. This came with certain limitations. eg., using su(1) or sudo(8) to get a root shell can overwrite the PS1 set during 'podman exec' with a value set by the operating system's existing start-up scripts depending on which environment variables were being retained. Now that the toolbox has it's own /etc/profile.d/toolbox.sh start-up script, it's time to move the PS1 to its rightful home. Since the start-up script and /run/.toolboxenv are present in older toolbox containers, this change should be fully backwards compatible and lead to a more robust PS1 without breaking older containers. https://github.com/debarshiray/toolbox/pull/148
debarshiray
force-pushed
the
wip/rishi/set-ps1-in-profile.d-toolbox
branch
from
May 3, 2019 18:21
05732e1 to
285d3b6
Compare
debarshiray
referenced
this pull request
May 3, 2019
This is better than setting an environment variable like TOOLBOX_CONTAINER with 'podman create' because it can't be unset later by commands like su(1) or sudo(8). One nice side-effect of doing it inside 'toolbox enter' is that it will automatically work with older toolbox containers. A subsequent commit will switch to using the /etc/profile.d/toolbox.sh start-up script to set the PS1 instead of doing it as part of the 'podman exec' invocation. Having the identification mechanism work with older toolbox containers is important to avoid breaking the PS1 for backwards compatibility. https://github.com/debarshiray/toolbox/pull/148
debarshiray
referenced
this pull request
May 3, 2019
The shell start-up scripts are where the PS1 is meant to be set. So far, the absence of a toolbox-specific start-up script was being worked around by setting the PS1 as part of the 'podman exec' invocation. This came with certain limitations. eg., using su(1) or sudo(8) to get a root shell can overwrite the PS1 set during 'podman exec' with a value set by the operating system's existing start-up scripts depending on which environment variables were being retained. Now that the toolbox has it's own /etc/profile.d/toolbox.sh start-up script, it's time to move the PS1 to its rightful home. Since the start-up script and /run/.toolboxenv are present in older toolbox containers, this change should be fully backwards compatible and lead to a more robust PS1 without breaking older containers. https://github.com/debarshiray/toolbox/pull/148
This is better than setting an environment variable like TOOLBOX_CONTAINER with 'podman create' because, unlike environment variables, it can't be unset later by commands like su(1) or sudo(8). One nice side-effect of doing it inside 'toolbox enter' is that it will automatically work with older toolbox containers. A subsequent commit will switch to using the /etc/profile.d/toolbox.sh start-up script to set the PS1 instead of doing it as part of the 'podman exec' invocation. Having the identification mechanism work with older toolbox containers is important to avoid breaking the PS1 for backwards compatibility. This reverts commit c7b7fa1 https://github.com/debarshiray/toolbox/pull/148
The shell start-up scripts are where the PS1 is meant to be set. So far, the absence of a toolbox-specific start-up script was being worked around by setting the PS1 as part of the 'podman exec' invocation. This came with certain limitations. eg., using su(1) or sudo(8) to get a root shell can overwrite the PS1 set during 'podman exec' with a value set by the operating system's existing start-up scripts depending on which environment variables were being retained. Now that the toolbox has it's own /etc/profile.d/toolbox.sh start-up script, it's time to move the PS1 to its rightful home. Since the start-up script and /run/.toolboxenv are present in older toolbox containers, this change should be fully backwards compatible and lead to a more robust PS1 without breaking older containers. https://github.com/debarshiray/toolbox/pull/148
debarshiray
force-pushed
the
wip/rishi/set-ps1-in-profile.d-toolbox
branch
from
May 6, 2019 10:51
285d3b6 to
0e38e7d
Compare
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The shell start-up scripts are where the PS1 is meant to be set. So
far, the absence of a toolbox-specific start-up script was being worked
around by setting the PS1 as part of the 'podman exec' invocation. This
came with certain limitations. eg., using su(1) or sudo(8) to get a
root shell can overwrite the PS1 set during 'podman exec' with a value
set by the operating system's existing start-up scripts depending on
which environment variables were being retained.
Now that the toolbox has it's own /etc/profile.d/toolbox.sh start-up
script, it's time to move the PS1 to its rightful home.
Since the start-up script and /run/.toolboxenv are present in older
toolbox containers, this change should be fully backwards compatible
and lead to a more robust PS1 without breaking older containers.