Why is setting process group (setpgrp) allowed in a docker container but not in a kubernetes pod

4/18/2018

If I run the following in a docker container (with python of course)

python -c 'import os; os.setpgrp()'

It executes just fine, but if I run it as a kubernetes job in the same container, it will return:

OSError: [Errno 1] Operation not permitted

Is there something about the process model of kubernetes compared to a standalone docker container that prevents processes in a container from setting their process group id? I can't seem to find any documentation or references to this.

-- John Greeley
docker
kubernetes
linux

0 Answers