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

标签 docker containers ibm-cloud su

我正在尝试“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/

相关文章:

docker - docker hub 上是否有针对不同操作系统的不同图像

c# - bluemix vm openstack 使用c++语言

python - 属性错误: Dict has no object class_name

使用不同的数据目录时docker没有响应

Docker和文件上传服务器

amazon-web-services - 计划在Beanstalk部署或ECS任务不使用EC2实例时停止/启动EC2实例?

spring-boot - 无法将 'server.port' 下的属性绑定(bind)到 java.lang.Integer

Docker 说已经存在一个同名的容器,尽管没有容器

image - 清理 Docker 镜像占用的磁盘空间

swift - Bluemix Cordova iOS 推送通知 - 看不到设备 - 内部服务器错误。未找到设备