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 d9a3433
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 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

0 comments on commit d9a3433

Please sign in to comment.