To add more context to the feature request, I have the following use-case:
* an OVS bridge gets created during the snap initialization;
* on snap removal it needs to be removed;
* however, by the time the code in the remove hook starts getting executed, all of the services required to do that are stopped (namely, ovsdb and vswitchd).
To make it more clear: the bridge is registered in the kernel (openvswitch kernel module), however, the tools used to trigger the removal talk to the user-space services which do the actual work of talking to the kernel.
In essence, I currently have to start those services back up before trying to remove the bridge:
To add more context to the feature request, I have the following use-case:
* an OVS bridge gets created during the snap initialization;
* on snap removal it needs to be removed;
* however, by the time the code in the remove hook starts getting executed, all of the services required to do that are stopped (namely, ovsdb and vswitchd).
To make it more clear: the bridge is registered in the kernel (openvswitch kernel module), however, the tools used to trigger the removal talk to the user-space services which do the actual work of talking to the kernel.
In essence, I currently have to start those services back up before trying to remove the bridge:
```
cat snap/hooks/remove
#!/bin/bash
set -ex
snapctl start microstack. ovsdb-server ovs-vswitchd
snapctl start microstack.
export LD_LIBRARY_ PATH=$LD_ LIBRARY_ PATH:$SNAP/ lib:$SNAP/ usr/lib: $SNAP/current/ lib/x86_ 64-linux- gnu:$SNAP/ usr/lib/ x86_64- linux-gnu local/bin/ ovs-vsctl --if-exists del-br br-ex
$SNAP/usr/
snapctl stop microstack. ovsdb-server ovs-vswitchd
snapctl stop microstack.
```
Having pre-remove would allow me to get rid of the manual startup of services in the remove hook.