我正在尝试“su”在IBM Containers / Bluemix中部署的容器中。
但是这样失败了。
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,它工作正常)。
这是解决它的解决方案:
$ 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
关于docker - IBM Container-su:无法创建子进程:资源暂时不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35683773/