Passing plugs/permissions to subprocesses

Hello

I’ve written a python script (“manager”) which handles some commands, and after which spawns another python script (“daemon”) that keeps running in the background using subprocess.

Now in this daemon I want to use the GPIO plug but I’m getting a python error:

RuntimeError: No access to /dev/mem

Which means I can’t access the GPIO. AppArmor itself it not showing any logs.

Any tips? Maybe declaring the daemon in the snapcraft.yaml, but I’ll need a way to start it up with parameters.

Kind regards