I’m attempting to make a snap for https://github.com/greenpau/ovn_exporter which requires read access to /run/openvswitch/ovsdb-server.14232.ctl where 14232 is the pid of the openvswitch process. Unfortunately, this changes each time the service runs and so I can’t simply add the whole path to the read attribute of the system-files plug. I also don’t have the option of changing openvswitch, this is purely a monitoring tool to observe and/or query it. Is there a facility for a wildcard or regex where I can specify, say, /run/openvswitch/ovsdb-server.*.ctl?
Wildcards are not supported in system-files by design unfortunately. You are probably better off with a new interface specific to openvswitch instead of using system-files for this purpose. If you need help creating the interface, providing the denials you see here would help to figure out what is needed, but if it’s just those files you mentioned with the wildcard on /run/oppenvswitch/ovsdb-server.* then it should be fairly straight forward
Thanks for that. There’s an existing openvswitch interface but it doesn’t do all that I need this one to do - perhaps you could point me at the source so I can see if it’s viable to modify it or write a fresh one.
Ah I hadn’t even realized there is an existing openvswitch interface, in that case just add the files you need to this variable in this file and create a PR:
Thanks - https://github.com/snapcore/snapd/pull/11062. If preferred, I could make a fresh interface for OVN based on this, just duplicating the openvswitch interface but with different files. I think they’re well connected enough to one another to have these in the same interface though.