ansible/roles/openqa/worker/files/openqa-swtpm@.service
Adam Williamson 13f59ad0eb 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>
2020-09-08 10:56:12 -07:00

13 lines
366 B
Desktop File

[Unit]
Description=openQA swtpm service
[Service]
User=_openqa-worker
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