3

I have committed a ubuntu image with a new user call "user" and then i create the container with the following command

 sudo docker run -u=user -ti test1 /bin/bash

I check that there are only two process running

user@1bc12c468f29:/$ ps
  PID TTY          TIME CMD
   1 ?        00:00:00 bash
   12 ?        00:00:00 ps

But after i set

ulimit -u 10

I cannot create any new process, even ls

user@1bc12c468f29:/$ ulimit -u 10
user@1bc12c468f29:/$ ls
bash: fork: retry: No child processes
bash: fork: retry: No child processes
bash: fork: retry: No child processes
bash: fork: retry: No child processes
bash: fork: Resource temporarily unavailable

Should ulimit -u 10 allow 10 processes running simultaneously?

sundayku
  • 172
  • 1
  • 7
  • possible duplicate of [how to set ulimit / file descriptor on docker container the image tag is phusion/baseimage-docker](http://stackoverflow.com/questions/24318543/how-to-set-ulimit-file-descriptor-on-docker-container-the-image-tag-is-phusion) – Regan Aug 17 '14 at 00:00
  • 1
    Thanks for you comment. In that post, he tries to rise the limit. But in my situation, i try to lower the limit, and it should work, but the result is strange. You suggestion seems not help much – sundayku Aug 17 '14 at 16:42
  • I guess there are hidden user process for each user. You can try `ulimit 20`, it shall work and also `ulimit -u` will report current number – Larry Cai Aug 18 '14 at 13:42
  • Thanks for your comment. I think you are correct. And i got more detail in this post [link](http://serverfault.com/questions/449363/understanding-ulimit-u) – sundayku Aug 28 '14 at 09:44

1 Answers1

1

output of ps doesn't give list of all running processes. It only gives list of processes running in your TTY. To get list of all running processes you can run: ps -ef. To get total number: ps -ef|wc -l

cipher
  • 59
  • 3