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>
13 lines
366 B
Desktop File
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
|