Perform additional tweaks to units

Use RemainAfterExit to avoid pvc-flush from auto-stopping immediately.

Use PartOf to tie services to the target itself.

Use --wait on flush to avoid daemon stopping before flush is complete.
This commit is contained in:
Joshua Boniface 2019-05-23 23:01:58 -04:00
parent e46aa22989
commit 4c5ce9b995
2 changed files with 4 additions and 1 deletions

View File

@ -3,12 +3,14 @@
[Unit] [Unit]
Description = Parallel Virtual Cluster autoflush daemon Description = Parallel Virtual Cluster autoflush daemon
After = pvcd.service After = pvcd.service
PartOf = pvcd.target
[Service] [Service]
Type = oneshot Type = oneshot
RemainAfterExit = true
WorkingDirectory = /usr/share/pvc WorkingDirectory = /usr/share/pvc
ExecStart = /usr/bin/pvc node unflush ExecStart = /usr/bin/pvc node unflush
ExecStop = /usr/bin/pvc node flush ExecStop = /usr/bin/pvc node flush --wait
[Install] [Install]
WantedBy = pvcd.target WantedBy = pvcd.target

View File

@ -3,6 +3,7 @@
[Unit] [Unit]
Description = Parallel Virtual Cluster node daemon Description = Parallel Virtual Cluster node daemon
After = network-online.target libvirtd.service zookeeper.service After = network-online.target libvirtd.service zookeeper.service
PartOf = pvcd.target
[Service] [Service]
Type = simple Type = simple