[Unit]
Description=libvirt secret daemon
Documentation=man:virtsecretd(8)
Documentation=https://libvirt.org/
BindsTo=virtsecretd.socket
Wants=virtsecretd-ro.socket
Wants=virtsecretd-admin.socket
After=virtsecretd.socket
After=virtsecretd-ro.socket
After=virtsecretd-admin.socket
Conflicts=libvirtd.service
After=libvirtd.service
After=network.target
After=dbus.service
After=apparmor.service
Requires=virt-secret-init-encryption.service
After=virt-secret-init-encryption.service

[Service]
Type=notify-reload
Environment=VIRTSECRETD_ARGS="--timeout 120"
EnvironmentFile=-/etc/conf.d/virtsecretd
ExecStart=/usr/bin/virtsecretd $VIRTSECRETD_ARGS
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
LoadCredentialEncrypted=secrets-encryption-key:/var/lib/libvirt/secrets/secrets-encryption-key
Environment=SECRETS_ENCRYPTION_KEY=%d/secrets-encryption-key

[Install]
WantedBy=multi-user.target
Also=virtsecretd.socket
Also=virtsecretd-ro.socket
Also=virtsecretd-admin.socket
