Docker Community Forums

Share and learn in the Docker community.

CentOS-based container; unable to sched_setscheduler


(Transentia) #1

I am trying to run a group of programs (all fairly old, originated in QNX 4/6, then ported to RHEL5/6) in a CentOS container.

For initial development purposes I am working on my OSX El-Capitan Macbook Pro which is running the latest Toolbox 1.11.0. I am also running b2d under parallels, rather than VirtualBox.

Somewhere about line 10 of main(), each application calls sched_setscheduler() to set SCHED_FIFO.

This barfs with ENOPERM.

I have looked at/tried various resources:

https://groups.google.com/forum/#!topic/docker-user/Nea6COW47GA (and linked response)
https://github.com/docker/docker/issues/13983

…but none of what is out there seem quite ‘all there’.

For example: most resources mention running --privileged and --cap-add-sys_nice and modifying “/sys/fs/cgroup/cpu/system.slice/cpu.rt_runtime_us.”

This doesn’t exist as far as I can see! I assume it is a ‘native’ thing?

I can’t see it in the container, nor in the boot2docker host itself.

In the b2d host, I can see:

/sys/fs/cgroup/cpu/docker/ea636c0f98fdb57b21f940fe65eebb64cd06cb9264dcb32a823a3c001e82ca12

but if I try to modify the relevant entry within this directory (I am ever the optimist!), I get:

# echo 95000 > cpu.rt_runtime_us 
sh: write error: Invalid argument

Thus, I am dead in the water.

So my question: has anybody actually managed to get this working with boot2docker?

PS: actually, I am not QUITE dead in the water. I have set up a work-around for now where I have a shared library consisting only of a reimplementation of sched_setscheduler that unconditionally succeeds. I then define that library in /etc/ld.so.preload so that my method is always called. This is really hacky and is NOT going to be viewed favourably by The Powers That Must Be Convinced That Docker Is Not New And So Too Scary To Contemplate…