apptainer / singularity

Singularity has been renamed to Apptainer as part of us moving the project to the Linux Foundation. This repo has been persisted as a snapshot right before the changes.
https://github.com/apptainer/apptainer
Other
2.53k stars 424 forks source link

[2.1.2] test.sh fails if my shell is not avail inside the container #187

Closed yarikoptic closed 8 years ago

yarikoptic commented 8 years ago
 + singularity shell -w container.img -c true                                          (retval=0) ERROR
ERROR: Shell does not exist in container: /bin/zsh
ERROR: Using /bin/sh instead...
Full output in: /tmp/tmp.SCbtE7htxK

I guess it should check SHELL, which is in my case /bin/zsh obviously ... overriding SHELL env var is not sufficient -- I guess since inside it populates with the same user record, so to use /bin/zsh in my case, which doesn't exist inside the container... should get installed may be? or reset it to /bin/bash or ... ?

gmkurtzer commented 8 years ago

So if I'm understanding correctly... /bin/sh is calling for /bin/zsh? hrmm, I'll have to check on that and try to replicate.

yarikoptic commented 8 years ago

I didn't check but thought that it relates to the fact that my user has zsh as the shell configured

gmkurtzer commented 8 years ago

Is zsh configured as your default shell in /etc/passwd?

Also what version of Singularity is this?

yarikoptic commented 8 years ago

On Wed, 10 Aug 2016, Gregory M. Kurtzer wrote:

Is zsh configured as your default shell in /etc/passwd?

yes

Also what version of Singularity is this?

2.1.2 (as in the subject line/title ;) )

gmkurtzer commented 8 years ago

I don't believe this is a problem anymore with the massive updates to master:

[gmk@centos7-x64]~/git/singularity-devel% grep gmk /etc/passwd                               
gmk:x:1000:1000:Gregory M. Kurtzer:/home/gmk:/bin/zsh
[gmk@centos7-x64]~/git/singularity-devel% singularity exec /tmp/Centos-7 grep gmk /etc/passwd
gmk:x:1000:1000:Gregory M. Kurtzer:/home/gmk:/bin/zsh
[gmk@centos7-x64]~/git/singularity-devel% singularity shell /tmp/Centos-7                    
Singularity: Invoking an interactive shell within container...

Singularity.Centos-7> echo $SHELL
/bin/sh
Singularity.Centos-7> exit
[gmk@centos7-x64]~/git/singularity-devel% 

Can you retest?

Thanks!

gmkurtzer commented 8 years ago

Closing, let me know if the issue is still a problem for you and I will reopen.

Thanks!