diff options
-rwxr-xr-x | buildos | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -893,7 +893,9 @@ function bbot_start () # <toolchain-name> <toolchain-index> # if [ "$b_word" = "configured" ]; then - for ((i=1; i <= ti; i++)); do + # Note: stop extra instance. + # + for ((i=1; i <= ti + 1; i++)); do if ! sudo systemctl stop "bbot-agent-$tn@$i"; then info "failed to stop bbot-agent-$tn@$i service, assuming not running" continue @@ -942,6 +944,7 @@ function bbot_start () # <toolchain-name> <toolchain-index> -e "s/^(Environment=TOOLCHAIN_NUM)=.*/\1=$tx/" \ -e "s/^(Environment=TOOLCHAIN_VER)=.*/\1=$tv/" \ -e "s/^(Environment=TOOLCHAIN_NAME)=.*/\1=$tn/" \ + -e "s/^(Environment=INSTANCE_MAX)=.*/\1=$ti/" \ -e "s/^(Nice)=.*/\1=$tc/" \ -e "s#^ExecStart=[^ ]+(.*)#ExecStart=$id/bin/bbot-agent\1#" \ "$id/lib/systemd/system/bbot-agent@.service" @@ -1019,8 +1022,10 @@ function bbot_start () # <toolchain-name> <toolchain-index> # the process has forked. Making sure the service has actually started is # done as part of the service monitoring. # + # Note: start extra instance. + # r=0 - for ((i=1; i <= ti; i++)); do + for ((i=1; i <= ti + 1; i++)); do if ! sudo systemctl start "bbot-agent-$tn@$i"; then info "failed to start bbot-agent-$tn@$i service instance" r=1 @@ -1195,7 +1200,9 @@ EOF # For each service instance check if it has failed. # - for ((i=1; i <= ti; i++)); do + # Note: check extra instance. + # + for ((i=1; i <= ti + 1; i++)); do if sudo systemctl is-failed --quiet "bbot-agent-$tn@$i"; then s="bbot-agent-$tn@$i service has failed, stopping" |