Skip to content

Commit

Permalink
Make systemctl call for kat-rocky-worker conditional (#3782)
Browse files Browse the repository at this point in the history
Co-authored-by: Jan Klopper <[email protected]>
  • Loading branch information
dekkers and underdarknl authored Oct 31, 2024
1 parent 14dc3b1 commit 8937ec8
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 10 deletions.
14 changes: 12 additions & 2 deletions scripts/installation/openkat-empty-job-queue.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

# Stop openKAT
echo "Stopping openKAT processes"
sudo systemctl stop xtdb-http-multinode kat-rocky kat-rocky-worker kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker
sudo systemctl stop xtdb-http-multinode kat-rocky kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker

# Kat-rocky-worker service was introduced in OpenKAT 1.18
if [ -f /usr/lib/systemd/system/kat-rocky-worker.service ]; then
sudo systemctl stop kat-rocky-worker
fi

# Start postgres, switch to the mula_db and empty the job queue
echo "Emptying job queue"
Expand All @@ -13,6 +18,11 @@ EOF

# Start openKAT
echo "Starting openKAT processes"
sudo systemctl start xtdb-http-multinode kat-rocky kat-rocky-worker kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker
sudo systemctl start xtdb-http-multinode kat-rocky kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker

# Kat-rocky-worker service was introduced in OpenKAT 1.18
if [ -f /usr/lib/systemd/system/kat-rocky-worker.service ]; then
sudo systemctl stop kat-rocky-worker
fi

echo "End of script. It might take a few more seconds for OpenKAT to be fully started and available."
14 changes: 12 additions & 2 deletions scripts/installation/openkat-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,19 @@ echo "Step 6.11 - Set kat permissions in rabbitmq"
sudo rabbitmqctl set_permissions -p "kat" "kat" ".*" ".*" ".*"

echo "Step 7 - Configure start at system boot"
sudo systemctl enable kat-rocky kat-rocky-worker kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker
sudo systemctl enable kat-rocky kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker

# Kat-rocky-worker service was introduced in OpenKAT 1.18
if [ -f /usr/lib/systemd/system/kat-rocky-worker.service ]; then
sudo systemctl enable kat-rocky-worker
fi

echo "Step 8 - Restart OpenKAT"
sudo systemctl restart kat-rocky kat-rocky-worker kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker
sudo systemctl restart kat-rocky kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker

# Kat-rocky-worker service was introduced in OpenKAT 1.18
if [ -f /usr/lib/systemd/system/kat-rocky-worker.service ]; then
sudo systemctl restart kat-rocky-worker
fi

echo "Step 9 - End of OpenKAT install script"
14 changes: 12 additions & 2 deletions scripts/installation/openkat-reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ fi
pushd /

echo "Stop OpenKAT"
sudo systemctl stop xtdb-http-multinode kat-rocky kat-rocky-worker kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker
sudo systemctl stop xtdb-http-multinode kat-rocky kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker

# Kat-rocky-worker service was introduced in OpenKAT 1.18
if [ -f /usr/lib/systemd/system/kat-rocky-worker.service ]; then
sudo systemctl stop kat-rocky-worker
fi

echo "Delete XTDB databases"
sudo rm -rf /var/lib/xtdb/*
Expand Down Expand Up @@ -89,6 +94,11 @@ if [[ ${1} != "no_super_user" ]]; then
fi

echo "Start OpenKAT"
sudo systemctl start xtdb-http-multinode kat-rocky kat-rocky-worker kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker
sudo systemctl start xtdb-http-multinode kat-rocky kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker

# Kat-rocky-worker service was introduced in OpenKAT 1.18
if [ -f /usr/lib/systemd/system/kat-rocky-worker.service ]; then
sudo systemctl start kat-rocky-worker
fi

popd
7 changes: 6 additions & 1 deletion scripts/installation/openkat-restart.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/bash

echo "Restarting openKAT..."
sudo systemctl restart xtdb-http-multinode kat-rocky kat-rocky-worker kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker
sudo systemctl restart xtdb-http-multinode kat-rocky kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker

# Kat-rocky-worker service was introduced in OpenKAT 1.18
if [ -f /usr/lib/systemd/system/kat-rocky-worker.service ]; then
sudo systemctl restart kat-rocky-worker
fi
7 changes: 6 additions & 1 deletion scripts/installation/openkat-start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/bash

echo "Starting openKAT..."
sudo systemctl start xtdb-http-multinode kat-rocky kat-rocky-worker kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker
sudo systemctl start xtdb-http-multinode kat-rocky kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker

# Kat-rocky-worker service was introduced in OpenKAT 1.18
if [ -f /usr/lib/systemd/system/kat-rocky-worker.service ]; then
sudo systemctl start kat-rocky-worker
fi
7 changes: 6 additions & 1 deletion scripts/installation/openkat-stop.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/bash

echo "Stopping openKAT..."
sudo systemctl stop xtdb-http-multinode kat-rocky kat-rocky-worker kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker
sudo systemctl stop xtdb-http-multinode kat-rocky kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker

# Kat-rocky-worker service was introduced in OpenKAT 1.18
if [ -f /usr/lib/systemd/system/kat-rocky-worker.service ]; then
sudo systemctl stop kat-rocky-worker
fi
7 changes: 6 additions & 1 deletion scripts/installation/openkat-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ sudo -u kat update-katalogus-db
sudo -u kat update-mula-db

echo "Step 7 - Restart OpenKAT"
sudo systemctl restart xtdb-http-multinode kat-rocky kat-rocky-worker kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker
sudo systemctl restart xtdb-http-multinode kat-rocky kat-mula kat-bytes kat-boefjes kat-normalizers kat-katalogus kat-keiko kat-octopoes kat-octopoes-worker

# Kat-rocky-worker service was introduced in OpenKAT 1.18
if [ -f /usr/lib/systemd/system/kat-rocky-worker.service ]; then
sudo systemctl restart kat-rocky-worker
fi

echo "End of OpenKAT update script"

0 comments on commit 8937ec8

Please sign in to comment.