From 6c58d52fa1a9e97ea165decc0c1f5d00fb3874ec Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 27 Oct 2022 13:54:59 -0400 Subject: [PATCH] Add node autoready oneshot unit This replicates some of the more important functionality of the defunct pvc-flush.service unit. On presence of a trigger file (i.e. /etc/pvc/autoready), it will trigger a "node ready" on boot. It does nothing on shutdown as this must be handled by other mechanisms, though a similar autoflush could be added as well. --- debian/pvc-daemon-node.install | 1 + debian/pvc-daemon-node.postinst | 1 + node-daemon/pvcautoready.service | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 node-daemon/pvcautoready.service diff --git a/debian/pvc-daemon-node.install b/debian/pvc-daemon-node.install index c10f86ab..4b85c0e1 100644 --- a/debian/pvc-daemon-node.install +++ b/debian/pvc-daemon-node.install @@ -3,4 +3,5 @@ node-daemon/pvcnoded.sample.yaml etc/pvc node-daemon/pvcnoded usr/share/pvc node-daemon/pvcnoded.service lib/systemd/system node-daemon/pvc.target lib/systemd/system +node-daemon/pvcautoready.service lib/systemd/system node-daemon/monitoring usr/share/pvc diff --git a/debian/pvc-daemon-node.postinst b/debian/pvc-daemon-node.postinst index c889451a..c8c7a963 100644 --- a/debian/pvc-daemon-node.postinst +++ b/debian/pvc-daemon-node.postinst @@ -5,6 +5,7 @@ systemctl daemon-reload # Enable the service and target systemctl enable /lib/systemd/system/pvcnoded.service +systemctl enable /lib/systemd/system/pvcautoready.service systemctl enable /lib/systemd/system/pvc.target # Inform administrator of the service restart/startup not occurring automatically diff --git a/node-daemon/pvcautoready.service b/node-daemon/pvcautoready.service new file mode 100644 index 00000000..d1149ba0 --- /dev/null +++ b/node-daemon/pvcautoready.service @@ -0,0 +1,19 @@ +# Parallel Virtual Cluster autoready oneshot + +[Unit] +Description = Parallel Virtual Cluster autoready oneshot +After = pvcnoded.service pvcapid.service zookeeper.service libvirtd.service ssh.service ceph.target network-online.target +Wants = pvcnoded.service pvcapid.service +PartOf = pvc.target +ConditionPathExists=/etc/pvc/autoready + +[Service] +Type = oneshot +RemainAfterExit = false +WorkingDirectory = /usr/share/pvc +TimeoutSec = 31min +ExecStartPre = /bin/sleep 60 +ExecStart = /usr/bin/pvc -c local node ready --wait + +[Install] +WantedBy = pvc.target