Using select on STDIN inside container

Hi all,

More of a Linux based question. I’m trying to use select on stdin to check for waiting input and it works fine for me in a container on my PC but on Torizon inside a debian container I get:

Exception has occurred: PermissionError
[Errno 1] Operation not permitted

Do I need to pass a device to the container that represents stdin? I tried /dev/stdin but that didn’t help. The container is already privileged but we are trying to get away from that.

My code is:

stdin_sel = selectors.DefaultSelector()
stdin_sel.register(sys.stdin, selectors.EVENT_READ, self._sock_read)

All suggestions very welcome.

Thanks

Ed

Ok, I think I figured this out. It works when I create a release version of the container and run the application there. It must be to do with stdin not being available during debug using the Torizon plugin.

On a related note, is there a way I can test to tell if the container is the release or debug versions?

Thanks

Ed

I’m glad you were able to resolve this on your own. As for release/debug versions, usually the Torizon extension will name the container accordingly. Also the debug container will usually be larger since it has to include debug tools and such.

Best Regards,
Jeremias