psanford / tpm-fido

A WebAuthn/U2F token protected by a TPM (Go/Linux)
MIT License
285 stars 17 forks source link

feat: add flag to run tpm-fido as a linux daemon #5

Closed Tedyst closed 2 years ago

Tedyst commented 2 years ago

The --daemon flag works by checking the existence of a pid file specific to this app, and if it exists there will be done some checks to see if the process is still alive.

psanford commented 2 years ago

Thank you for your interest in tpm-fido. In general, I think its better to have your init process (systemd, upstart, runit, etc.) manage deamonizing services rather than doing it within every service. As such, I won't be accepting this change.

I run tpm-fido from a user systemd unit that starts automatically when i login. This is the way I'd recommend others run it as well:

cat ~/.config/systemd/user/tpm-fido.service
[Unit]
Description=TPM Fido

[Service]
ExecStart=/usr/local/bin/tpm-fido

[Install]
WantedBy=default.target