Only reconfigure bid on some actions

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 commit is contained in:
Nick Huber 2019-06-14 14:47:46 -07:00
parent a528e00a53
commit 364df3a508
3 changed files with 11 additions and 2 deletions

View File

@ -8,6 +8,7 @@ Type=oneshot
RemainAfterExit=true
ExecStart=/usr/local/bin/yap start-all
ExecStop=/usr/local/bin/yap stop-all
ExecReload=/usr/local/bin/yap reload
[Install]
WantedBy=multi-user.target

View File

@ -224,6 +224,11 @@ function stop_all() {
}
function reload() {
echo 'configure soft' | pwanbirdc
}
function restart_all() {
for name in "${!SPACES[@]}" ; do
stop $name
@ -328,6 +333,9 @@ case "$action" in
stop $2
start $2
;;
reload)
reload
;;
status)
status $2
;;

4
yap
View File

@ -838,7 +838,7 @@ function aggregator_set_space_bird_config() {
set_var_from_file "/aggregators/$aggregator/spaces/$space/bird_config" $file
salt_update node-$aggregator ||:
salt_exec node-$aggregator service.restart yap ||:
salt_exec node-$aggregator service.reload yap ||:
aggregator_show $aggregator
}
@ -856,7 +856,7 @@ function aggregator_remove_space_bird_config() {
del_var "/aggregators/$aggregator/spaces/$space/bird_config"
salt_update node-$aggregator ||:
salt_exec node-$aggregator service.restart yap ||:
salt_exec node-$aggregator service.reload yap ||:
aggregator_show $aggregator
}