IBM Container – su:无法创buildsubprocess:资源暂时不可用

我试图在部署在IBM Containers / Bluemix中的容器中“su”。 但是它失败了。

root@ubuntu142:/tmp# cf ic exec -it mysshd bash [root@instance-001652d1 /]# adduser ubuntu [root@instance-001652d1 /]# su - ubuntu su: cannot create child process: Resource temporarily unavailable 

这在我的本地docker环境中工作正常。 我也尝试在启动脚本(用户已经定义)“su”,但也失败了相同的消息(从日志)。 (其实,我正在尝试使用“su db2inst1”来部署DB2-Express-C ..)在IBM容器中是否有任何限制,即“su”被禁止?

提前致谢。

我只在Centos 7容器实例中看到过这个问题(对Ubuntu来说工作正常)。

这是解决它的解决scheme:

 $ cf ic exec -it ads-centos bash [root@instance-00173f1f /]# adduser ubuntu [root@instance-00173f1f /]# su - ubuntu su: cannot create child process: Resource temporarily unavailable [root@instance-00173f1f /]# cd etc [root@instance-00173f1f etc]# cd pam.d [root@instance-00173f1f pam.d]# vi su ** change all session variables to 'optional' and save changes ** ** see how file should be below ** [root@instance-00173f1f pam.d]# su - ubuntu [ubuntu@instance-00173f1f ~]$ id uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu) [ubuntu@instance-00173f1f ~]$ 

这是如何su文件应该是

 #%PAM-1.0 auth sufficient pam_rootok.so # Uncomment the following line to implicitly trust users in the "wheel" group. #auth sufficient pam_wheel.so trust use_uid # Uncomment the following line to require a user to be in the "wheel" group. #auth required pam_wheel.so use_uid auth substack system-auth auth include postlogin account sufficient pam_succeed_if.so uid = 0 use_uid quiet account include system-auth password include system-auth session optional system-auth session optional postlogin session optional pam_xauth.so