The actual restart might fail in such a way that it doesn't get into the
other parts of the code, so just preempt this by removing the
configuration early.
DEV-2560
The yap service on aggregators also no longer runs `yap
check-policy-rules` as this would almost always log the following on
boot:
Unable to connect to server control socket (/var/run/bonding/pwan-outside-bird.sock): No such file or directory
The individual space services run this check after start on their
specific space.
DEV-2512
There is a new service template for yap spaces:
systemctl status yap-space@<space key>.service
The running of the services is managed by the main yap service still,
which reads the configuration expressed through salt and runs the
relevant systemctl commands to start/stop spaces as required. See:
https://www.freedesktop.org/software/systemd/man/systemd.service.html#Service%20Templates
Some other fixes included:
- Remove empty lines in /etc/yap/config file with jinja2 control characters
- Fix `stop_unknown` function which previously wouldn't remove leftover ip
rules
- Specifically lock around bulk operations like `start_all` instead of
around running yap in any capacity. Running operations on specific
spaces will also not lock anymore so that multiple spaces can be
started simultaneously.
- Defer adding VLAN interfaces until space is up and running in bird to
avoid having to clean this up if it fails.
Fixes DEV-2512
The 'start-all' had to be moved to an ExecStartPre so that the service
can detect a failure, since anything in ExecStart will be considered a
success due to RemainAfterExit=True. See
https://github.com/systemd/systemd/issues/3396 for more details.
DEV-2457
agg-set-space-bird-config and agg-remove-space-bird-config don't need to
restart all of yap to apply their changes, so just update the files and
reconfigure bird instead to save on some outage time.
DEV-2446
This should make YAP run if and only if node is running, which is the
desired behaviour.
This commit also includes making the yap-policy-checker bind to and
start after yap for similar reasons.
DEV-2312