Skip to content

Commit

Permalink
improvement: check if lqos_node_manager exists in build_dpkg.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
interduo committed Aug 2, 2024
1 parent 292662d commit 4b4599f
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/build_dpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4b4599f

Please sign in to comment.