How to Manage System services from my snapp app?

I want to be able to start, restart, stop or get status of services of the OS where my snap app is installed via my snap app. How do I do it?

There isn’t an interface that grants those permissions for arbitrary system services. If you only care about services provided by your snap, you can control them via the snapctl program (using its start, stop, and restart sub-commands).

If you want unrestricted access to systemd, the only option currently available is classic confinement. This runs your application in a similar environment to traditional Linux apps. As this avoids the normal strict confinement sandbox, you would need to request permission to publish such a snap on the store detailing why you need the added permissions.

1 Like