openstack-snaps / snap-openvswitch

Snap of Open vSwitch
3 stars 1 forks source link

Error Using OVS inside a Snap Package #3

Open vahid-dan opened 5 years ago

vahid-dan commented 5 years ago

Hi;

I know this issue is not about your snap package, but I'd be more than grateful if you could answer me.

I want to use OVS inside a snap package to add network bridges. It works on x64 Ubuntu following your snapcraft.yaml and building OVS. But I couldn't do it on RPi. So, as my plan B, I have added openvswitch-switch, openvswitch-common, and uuid-runtime to my stage packages and I'm using the same ovs-wrapper as you are. But while creating the bridge, I get this error:

RuntimeError: Subprocess: "['/snap/mysnap/x1/usr/bin/ovs-vsctl', '--may-exist', 'add-br', 'mysnapbr0']" failed, std err = b'ovs-vsctl: unix:/var/run/openvswitch/db.sock: database connection failed (No such file or directory)\n'

Thanks in advance. :-) Vahid

javacruft commented 5 years ago

The distro built packages have hardcoded paths to runtime directories which are not snap compatible - this is why we rebuild openvswitch with snap specific parameters.

javacruft commented 5 years ago
    configflags:
      - "--localstatedir=/var/snap/$SNAPCRAFT_PROJECT_NAME/common"
      - "--sysconfdir=/var/snap/$SNAPCRAFT_PROJECT_NAME/etc"