profile
viewpoint

carstenpohllhind/docker-stacks 0

Ready-to-run Docker images containing Jupyter applications

carstenpohllhind/tanka 0

Flexible, reusable and concise configuration for Kubernetes

carstenpohllhind/tfawstest 0

Trying to deploy stuff with terraform on aws

PR opened jupyter/docker-stacks

Changed the regular expression in start.sh that reads the /etc/sudoer…

Fixes https://github.com/jupyter/docker-stacks/issues/1064

…s file and

adds the conda path as a secure path to sudo.

The regular expression expects that the equals sign has no leading and trailing spaces after the parameter secure_path. Furthermore it expects that the value is enclosed in double quotes.

This is the case for the sudoers file in debian based distributions, but the in centos / redhat based distributions this is not the case. The default value of the secure_path in centos / redhat based distributions has no double quotes and leading and trailing spaces.

This change adds optional spaces before and after the space, and makes the double quotes optional.

+1 -1

0 comment

1 changed file

pr created time in a month

issue openedjupyter/docker-stacks

start.sh adds conda path to secure_path for sudoers, which fails on centos redhat images

What docker image you are using?

jupyter/base-notebook

What complete docker command do you run to launch the container (omitting sensitive values)?

This does not apply here.

What steps do you take once the container is running to reproduce the issue?

If you change the docker image to a redhat / centos based image, the start.sh will fail, and you will see an output similar to: Set username to: jovyan usermod: no changes Executing the command: jupyterhub-singleuser --ip=0.0.0.0 sudo: jupyterhub-singleuser: command not found

What do you expect to happen?

The notebook should start, and the start should not throw an error.

What actually happens?

The notebook does not start.

Additional info

The problem lies within the sed command, that tries to get the information of the secure_path from the sudoers file. The regexp inside the sed command expects spaces before and after the equals sign, and double quotes before the path variables. This is the case in the Ubuntu / debian-esque /etc/sudoers file, but not in an centos based image, wich omits the double quotes and has trailing and leading spaces before the parameter name.

created time in a month

create barnchcarstenpohllhind/docker-stacks

branch : regexp-centos-friendly

created branch time in a month

push eventcarstenpohllhind/docker-stacks

Carsten Pohl

commit sha 0710677ce256317ebd403c21656d9fc145f2bf04

Changed the regular expression in start.sh that reads the /etc/sudoers file and adds the conda path as a secure path to sudo. The regular expression expects that the equals sign has no leading and trailing spaces after the parameter secure_path. Furthermore it expects that the value is enclosed in double quotes. This is the case for the sudoers file in debian based distributions, but the in centos / redhat based distributions this is not the case. The default value of the secure_path in centos / redhat based distributions has no double quotes and leading and trailing spaces. This change adds optional spaces before and after the space, and makes the double quotes optional.

view details

push time in a month

fork carstenpohllhind/docker-stacks

Ready-to-run Docker images containing Jupyter applications

https://jupyter-docker-stacks.readthedocs.io

fork in a month

more