Hi all,
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):
torizon@3cbd30b966fc:/$ dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1 "org.freedesktop.login1.Manager.Reboot" boolean:true
Error org.freedesktop.DBus.Error.AccessDenied: Permission denied
From the torizon best practices document, it seems that
these tasks can be performed without root permissions inside a container
The main content of my config.yaml
is:
extraparms:
common:
mounts: '[{ type: "bind", source: "/dev", target: "/dev", propagation: "shared"
}, {type: "bind", source: "/var/run/dbus", target: "/var/run/dbus", propagation:
"shared"}]'
privileged: 'true'
...
props:
common:
appargs: ''
appname: CarrotGui
arg: ''
command: ''
env: ''
expose: ''
extrapackages: dbus python3-dbus
language: python
main: main.py
preinstallcommands: COPY carrot-0.3.0-py3-none-any.whl /carrot-0.3.0-py3-none-any.whl
runtime: python3
sdkpostinstallcommands: ''
sdkpreinstallcommands: ''
targetcommands: ''
targetfiles: ''
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.
Thank you.
Giulio