openqa/worker: have swtpm service restart on success

This is because swtpm is designed not to be persistent, it's
sort of tied to a single "system" (VM in this case). We can't
expect an instance will stick around after it's been "used", it
doesn't do that, it exits successfully. So we need to restart it
when that happens.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2020-09-08 10:56:12 -07:00
parent 76748dda43
commit 13f59ad0eb

View file

@ -7,6 +7,7 @@ ExecStartPre=-/usr/bin/rm -rf /tmp/mytpm%I
ExecStartPre=/usr/bin/mkdir -p /tmp/mytpm%I
ExecStart=/usr/bin/swtpm socket --tpm2 --tpmstate dir=/tmp/mytpm%I --ctrl type=unixio,path=/tmp/mytpm%I/swtpm-sock --log level=20
ExecReload=/bin/true
Restart=on-success
[Install]
WantedBy=multi-user.target