Container (non-root) user can't write to /dev/stdout or /dev/stderr

Ok, I think I have a fix for this. Here’s the output I get for my process:

$ ls -lah /proc/233/fd
total 0
dr-x------    2 appuser  appuser        0 Feb 20 17:09 .
dr-xr-xr-x    9 appuser  appuser        0 Feb 20 17:08 ..
lr-x------    1 appuser  appuser       64 Feb 20 17:09 0 -> /dev/null
l-wx------    1 appuser  appuser       64 Feb 20 17:09 1 -> pipe:[4328]
lrwx------    1 appuser  appuser       64 Feb 20 17:09 10 -> socket:[4404]
l-wx------    1 appuser  appuser       64 Feb 20 17:09 2 -> pipe:[4329]
# ...

Which looks right!

I su - appuser and then echoed into /proc/233/fd/1 and there were no errors and it did appear in my app logs.

I’ve pushed this change to all hosts now. You’ll have to restart your app instances to get the new init version (08b4c2b). If you’re using machines, you’ll need to update your machine to purge the rootfs cache for it.

4 Likes