MarketSquare / MarketSquare/SSHLibrary

bash_profile not applied to the new shell when using "Execute Command"

Open
#125 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
167
Forks
145
PR merge metrics
No merged PRs in 30d

Description

The .bash_profile doesn't get loaded in the new shell after "Execute Command" keyword.
This is probably because the new shell is not opened as "login-shell" i.e. "shopt login_shell" is "off" in the new shell.
Correction: the new shell should also open as "login-shell"

logs:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

20141105 15:27:07.608 - INFO - +-- START KW: ${sout}, ${serr}, ${rc} = SSHLibrary.Execute Command [ shopt login_shell | return_rc=True | return_stdout=True | return_stderr=True ]
20141105 15:27:07.608 - INFO - Executing command 'shopt login_shell'.
20141105 15:27:07.608 - DEBUG - [chan 3] Max packet in: 32768 bytes
20141105 15:27:07.717 - INFO - Command exited with return code 1.
20141105 15:27:07.717 - INFO - ${sout} = login_shell off
20141105 15:27:07.717 - INFO - ${serr} =
20141105 15:27:07.717 - INFO - ${rc} = 1
...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20141105 15:27:07.717 - INFO - +-- START KW: SSHLibrary.Write [ shopt login_shell ]
20141105 15:27:07.748 - INFO - shopt login_shell
...
20141105 15:27:07.748 - INFO - login_shell on

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Execute Command keyword and reproduce the behavior by checking `shopt login_shell` and whether `.bash_profile` is loaded, comparing it with the Write keyword shown in the logs. Done means commands opened by Execute Command use a login shell and apply `.bash_profile` as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.