I use PAM to authenticate users in a web service in the snap. This use case requires the account-control interface.
The account-control interface is not auto connected. Normally after snap installed, the web server started before the account-control interface was connected.
It seems that the permissions were not granted to web service immediately after account-control is connected. Restart of web server is needed.
Then I use hook connect –plug-account-control to restart the web service automatically. It works.
Just out of curious, Is that how it was designed? After interfaces connected, the service need to be restarted?
Instead of wrapping your service in a script, you can also implement an interface hook that runs when that interface is connected. Within that hook, you can make sure your service is restarted with snapctl restart <snapname>.<servicename>.