IBM Container - su:无法创建子进程:资源暂时不可用

ish*_*330 0 containers su docker ibm-cloud

我试图在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
Run Code Online (Sandbox Code Playgroud)

这在我的本地docker环境中工作正常.我也尝试在启动脚本中使用"su"(用户已定义),但它也失败了相同的消息(来自日志).(实际上,我正在尝试使用"su db2inst1"部署DB2-Express-C ..)IBM容器中是否存在禁止"su"的限制?

提前致谢.

Ale*_*lva 7

我在Centos 7容器实例中只看到了这个问题(它适用于Ubuntu).

这是修复它的解决方案:

$ 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 ~]$ 
Run Code Online (Sandbox Code Playgroud)

这是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
Run Code Online (Sandbox Code Playgroud)