0

I have simple app, one of its functionalities ends with shutting down the computer using Posix.system("shutdown now"); In the ordinary ninja compiled version, the app works fine. However, in the flatpak version, it does not work. I tried to repackaging it again with adding couple of finish args in the yml file.,

finish-args:
  - '--share=ipc'
  - '--socket=fallback-x11'
  - '--socket=wayland'
  - '--filesystem=home'
  - '--socket=session-bus'
  - '--socket=system-bus' 

but it does not work too.

SaidbakR
  • 13,303
  • 20
  • 101
  • 195

1 Answers1

0

This is likely due to Flatpaks running in a sandbox with limited permissions, this prevents access to other processes and limits access to the operating system.

You have given your Flatpak access to the system D-Bus, so you can try using the PowerOff method available through org.freedesktop.systemd1.Manager.

AlThomas
  • 4,169
  • 12
  • 22