In a container (Pyside2+QML) built with VSCode for torizon-core-docker-colibri-imx8x-Tezi_5.7.0+build.17.tar I tried to halt/reboot the host thru dbus as directed in the best practice torizon best practices but I have a permission problem (only with user: torizon, root is ok):
I turned on the privileged mode because the user must be able to plug and play some USB sensors.
How can I solve the problem? What steps am I missing? I tried to put a configuration file in /etc/dbus-1/system.d with policy but I was unable to fix the problem.
I believe the article meant that these tasks can be performed without running the container in privileged mode (i.e. with option --privileged). The commands themselves should be executed as root, even inside a container.
I will confirm internally if this is really the case, and if it is, the text will be altered to avoid confusion.
I can confirm that the article indeed means “without root permissions” as “without privileged mode”, and you would still need to run commands as root if necessary.
The specific section you referred will be rewritten to better reflect this. Thanks for your question!
Would running the commands as root be a suitable alternative for you?
I managed to shutdown from the container without password by using the scripts mentioned above, running with the user root but creating the shared file inside /var/run/shutdown_signal as torizon user:
sudo -u torizon sh -c 'echo "waiting" > /var/run/my_dir/shutdown_signal'
thus I can write over it from inside the container.
Since running containers with root (privileged) permissions isn’t in best practices, these tasks can be performed without root permissions inside a container.
Please update the article to be explicit about what “without root permissions” means in this context, because it does need root permissions.
Could you please open a new thread with your exact question, and use-case of what you are trying to do. This thread is quite old and the article that was referenced in this thread is very different now compared to how it was when this thread was originally created. So it would be best to just open a new thread so we can have a fresh discussion with you regarding whatever questions you may have.