From aef38639cf9cf644e67d1da1c804f135e0c5dcbe Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Wed, 15 Nov 2023 19:13:48 -0500 Subject: [PATCH] Rename pvcapid-worker to pvcworkerd --- api-daemon/{pvcapid-worker.service => pvcworkerd.service} | 6 +++--- api-daemon/{pvcapid-worker.sh => pvcworkerd.sh} | 2 +- build-and-deploy.sh | 2 +- debian/pvc-daemon-api.install | 4 ++-- debian/pvc-daemon-api.postinst | 8 ++++---- node-daemon/pvcnoded/Daemon.py | 2 +- node-daemon/pvcnoded/objects/NodeInstance.py | 2 +- node-daemon/pvcnoded/util/services.py | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) rename api-daemon/{pvcapid-worker.service => pvcworkerd.service} (57%) rename api-daemon/{pvcapid-worker.sh => pvcworkerd.sh} (95%) diff --git a/api-daemon/pvcapid-worker.service b/api-daemon/pvcworkerd.service similarity index 57% rename from api-daemon/pvcapid-worker.service rename to api-daemon/pvcworkerd.service index f79f58f5..655d9fdf 100644 --- a/api-daemon/pvcapid-worker.service +++ b/api-daemon/pvcworkerd.service @@ -1,7 +1,7 @@ -# Parallel Virtual Cluster Provisioner API provisioner worker unit file +# Parallel Virtual Cluster Celery Worker daemon unit file [Unit] -Description = Parallel Virtual Cluster API provisioner worker +Description = Parallel Virtual Cluster Celery Worker daemon After = network-online.target [Service] @@ -9,7 +9,7 @@ Type = simple WorkingDirectory = /usr/share/pvc Environment = PYTHONUNBUFFERED=true Environment = PVC_CONFIG_FILE=/etc/pvc/pvcapid.yaml -ExecStart = /usr/share/pvc/pvcapid-worker.sh +ExecStart = /usr/share/pvc/pvcworkerd.sh Restart = on-failure [Install] diff --git a/api-daemon/pvcapid-worker.sh b/api-daemon/pvcworkerd.sh similarity index 95% rename from api-daemon/pvcapid-worker.sh rename to api-daemon/pvcworkerd.sh index 53cf7f27..34b2bbeb 100755 --- a/api-daemon/pvcapid-worker.sh +++ b/api-daemon/pvcworkerd.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# pvcapid-worker.py - API Celery worker daemon startup stub +# pvcworkerd.py - API Celery worker daemon startup stub # Part of the Parallel Virtual Cluster (PVC) system # # Copyright (C) 2018-2022 Joshua M. Boniface diff --git a/build-and-deploy.sh b/build-and-deploy.sh index f298e03d..1d2a6874 100755 --- a/build-and-deploy.sh +++ b/build-and-deploy.sh @@ -58,7 +58,7 @@ for HOST in ${HOSTS[@]}; do echo " done." echo -n "Restarting PVC daemons..." ssh $HOST $SUDO systemctl restart pvcapid &>/dev/null - ssh $HOST $SUDO systemctl restart pvcapid-worker &>/dev/null + ssh $HOST $SUDO systemctl restart pvcworkerd &>/dev/null ssh $HOST $SUDO systemctl restart pvcnoded &>/dev/null echo " done." echo -n "Waiting for node daemon to be running..." diff --git a/debian/pvc-daemon-api.install b/debian/pvc-daemon-api.install index 234c9806..415b4bb2 100644 --- a/debian/pvc-daemon-api.install +++ b/debian/pvc-daemon-api.install @@ -4,7 +4,7 @@ api-daemon/pvc-api-db-upgrade usr/share/pvc api-daemon/pvcapid.sample.yaml usr/share/pvc api-daemon/pvcapid usr/share/pvc api-daemon/pvcapid.service lib/systemd/system -api-daemon/pvcapid-worker.service lib/systemd/system -api-daemon/pvcapid-worker.sh usr/share/pvc +api-daemon/pvcworkerd.service lib/systemd/system +api-daemon/pvcworkerd.sh usr/share/pvc api-daemon/provisioner usr/share/pvc api-daemon/migrations usr/share/pvc diff --git a/debian/pvc-daemon-api.postinst b/debian/pvc-daemon-api.postinst index 9fc3bc07..c0f2ec27 100644 --- a/debian/pvc-daemon-api.postinst +++ b/debian/pvc-daemon-api.postinst @@ -10,13 +10,13 @@ if systemctl is-active --quiet pvcapid.service; then systemctl start pvcapid.service fi # Restart the worker daemon -if systemctl is-active --quiet pvcapid-worker.service; then - systemctl stop pvcapid-worker.service - systemctl start pvcapid-worker.service +if systemctl is-active --quiet pvcworkerd.service; then + systemctl stop pvcworkerd.service + systemctl start pvcworkerd.service fi if [ ! -f /etc/pvc/pvcapid.yaml ]; then - echo "NOTE: The PVC client API daemon (pvcapid.service) and the PVC provisioner worker daemon (pvcapid-worker.service) have not been started; create a config file at /etc/pvc/pvcapid.yaml, then run the database configuration (/usr/share/pvc/pvc-api-db-upgrade) and start them manually." + echo "NOTE: The PVC client API daemon (pvcapid.service) and the PVC Worker daemon (pvcworkerd.service) have not been started; create a config file at /etc/pvc/pvcapid.yaml, then run the database configuration (/usr/share/pvc/pvc-api-db-upgrade) and start them manually." fi # Clean up any old sample configs diff --git a/node-daemon/pvcnoded/Daemon.py b/node-daemon/pvcnoded/Daemon.py index f5be1075..de2ab0ec 100644 --- a/node-daemon/pvcnoded/Daemon.py +++ b/node-daemon/pvcnoded/Daemon.py @@ -188,7 +188,7 @@ def entrypoint(): # Restart the API daemons if applicable logger.out("Restarting services", state="s") - common.run_os_command("systemctl restart pvcapid-worker.service") + common.run_os_command("systemctl restart pvcworkerd.service") if zkhandler.read("base.config.primary_node") == config["node_hostname"]: common.run_os_command("systemctl restart pvcapid.service") diff --git a/node-daemon/pvcnoded/objects/NodeInstance.py b/node-daemon/pvcnoded/objects/NodeInstance.py index 134dbe68..f9c9699e 100644 --- a/node-daemon/pvcnoded/objects/NodeInstance.py +++ b/node-daemon/pvcnoded/objects/NodeInstance.py @@ -607,7 +607,7 @@ class NodeInstance(object): patroni_failed = False time.sleep(0.2) break - # 6. Start client API (and provisioner worker) + # 6. Start client API if self.config["enable_api"]: self.logger.out("Starting PVC API client service", state="i") common.run_os_command("systemctl enable pvcapid.service") diff --git a/node-daemon/pvcnoded/util/services.py b/node-daemon/pvcnoded/util/services.py index ede2c237..38d12fc4 100644 --- a/node-daemon/pvcnoded/util/services.py +++ b/node-daemon/pvcnoded/util/services.py @@ -80,7 +80,7 @@ def start_api_worker(logger, config): if config["enable_api"]: logger.out("Starting API worker daemon", state="i") # TODO: Move our handling out of Systemd and integrate it directly as a subprocess? - common.run_os_command("systemctl start pvcapid-worker.service") + common.run_os_command("systemctl start pvcworkerd.service") def start_system_services(logger, config):