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