Open zhulinpinyu opened 3 years ago
That depends on how you actually start the kiosk app and if your elixir application runs as root (that is the case when running under Nerves) or not.
Basically you should create user and group for your kiosk process - let's assume these would be user kiosk
and groupkiosk
(user kiosk
has group kiosk
as it's primary group)
Than you need to do chgrp kiosk /dev/vchiq
and chmod 770 /dev/vchiq
If your elixir app is running as root, you can do it in the start
method of your Application
using :os.cmd
like:
def start(_type, _args) do
:os.cmd('chgrp kiosk /dev/vchiq')
:os.cmd('chmod 770 /dev/vchiq')
...
end
If your elixir app is not running as root, you need to execute chmod
and chgrp
commands as root before starting kiosk application.
Another option can be udev rule with the same effects, chgrp
and chmod
about this description, how can I set permissions for
/dev/vchiq