I wonder if you just didn't try all the permutations here. You mention that
you did try /etc/profile, but possibly you didn't try it again after
configuring shell_cmd?

Quoting from the Bash manpage:

>        When  bash  is  invoked  as  an interactive login shell, or as a
> non-interactive shell with the --login
>        option, it first reads and executes commands from the file
> /etc/profile, if that  file  exists.   After
>        reading  that  file,  it  looks  for ~/.bash_profile,
> ~/.bash_login, and ~/.profile, in that order, and
>        reads and executes commands from the first one that exists and is
> readable.  The --noprofile option may
>        be used when the shell is started to inhibit this behavior.
>

Without shell_cmd I wouldn't expect any profile settings to be read,
because Popen just directly launches the singleuser server without an
intervening Bash process.


On Mon, Mar 5, 2018 at 8:38 AM, <[email protected]> wrote:

> Hi,
>
> I set up the vanilla Jupyterhub (0.8.1 on an Ubuntu 16.04 LTS server) with
> a basically unmodified configuration, except for SSL certs. The bash.bashrc
> (I also tried /etc/profile) file in /etc/ contains some additional export
> entries for PATH and PYTHONPATH, but they are never avaiblable in the
> notebooks unless I set them myself using
>
> import sys
> sys.path.append('/opt/my/speciallibrary')
>
> which as you can imagine is kind of impractical. However, the variables
> are available in the normal Python REPL as well as in the terminal in
> Jupyter.
>
> The generated default configuration suggests that those variables are
> passed through the filter, therefore his shouldn't pose a problem.
> *which -a* suggests all libraries are installed globally and otherwise
> everything works as it should. I'm running the hub with sudo as this is the
> suggested method to get multiple users with the default settings. It's a
> demo server for a notebook plugin prototype and all users can be trusted to
> not break stuff on purpose.
> *jupyter troubleshoot* displays the correct $PATH and sys.path values, so
> the variables are in Jupyter but somehow omitted or reset by the kernels?
>
> MinRK figured it could have something to do with the spawners not using
> login shells so he suggested to run one previous to starting the kernel by
> setting the configuration
>
>
> c.LocalProcessSpawner.shell_cmd = ['bash', '-l', '-c']
>
> but unfortunately that doesn't seem to have any effect, either.
>
> Does anyone have an idea what else could have gone wrong or is missing?
>
> I'm comming straight from https://github.com/jupyterhub/
> jupyterhub/issues/1695 and am hoping to find more input here, because
> it's still unclear to me if this even is a bug; which it probably isn't.
>
> Best regards.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jupyter/8fa8b180-87b3-41ff-b229-f9874b778cd4%40googlegroups.com
> <https://groups.google.com/d/msgid/jupyter/8fa8b180-87b3-41ff-b229-f9874b778cd4%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAPuy8go4v8v6DNE0j7KPZNmgQshnWyG4C1OAc%2B4y23bnBX0CCg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to