diff --git a/src/build_dpkg.sh b/src/build_dpkg.sh index 6e4cf55e..68130a0b 100755 --- a/src/build_dpkg.sh +++ b/src/build_dpkg.sh @@ -69,9 +69,20 @@ sudo python3 -m pip install --root-user-action=ignore --quiet --break-system-pac cp /opt/libreqos/src/bin/lqosd.service.example /etc/systemd/system/lqosd.service cp /opt/libreqos/src/bin/lqos_scheduler.service.example /etc/systemd/system/lqos_scheduler.service -/bin/systemctl stop lqos_node_manager # In case it's running from a previous release -/bin/systemctl disable lqos_node_manager # In case it's running from a previous release -rm -f /etc/systemd/system/lqosd_node_manager.service # In case it's running from a previous release +service_exists() { + local n=\$1 + if [[ \$(systemctl list-units --all -t service --full --no-legend "$n.service" | sed 's/^\s*//g' | cut -f1 -d' ') == \$n.service ]]; then + return 0 + else + return 1 + fi +} + +if service_exists lqos_node_manager; then + /bin/systemctl stop lqos_node_manager # In case it's running from a previous release + /bin/systemctl disable lqos_node_manager # In case it's running from a previous release + rm -f /etc/systemd/system/lqosd_node_manager.service # In case it's running from a previous release +fi /bin/systemctl daemon-reload /bin/systemctl enable lqosd lqos_scheduler @@ -130,7 +141,6 @@ done pushd rust/lqosd > /dev/null || exit ./copy_files.sh popd || exit -cp -r bin/static2/* $LQOS_DIR/bin/static2 #################################################### # Add Message of the Day