uunicorn / python-validity

Validity fingerprint sensor prototype
MIT License
990 stars 83 forks source link

Fix issue where /var/lib/python-validity doesn't exist on daemon startup #158

Closed mattgia closed 1 year ago

mattgia commented 1 year ago

This issue seems to be the result of the changes in #156.

The /var/run directory is symlinked to /run which is ephemeral, and cleared on each reboot. This causes an issue where the service fails to start because the /var/run/python-validity dir no longer exists.

This change is quite simple, it just makes sure the directory exists before doing anything else.

I realized after making the changes that systemd-tmpfiles exists for this purpose. If you would prefer I go with this approach I can attempt to make this change later, but in a way I like the pure python approach because we don't need extra config (I also consolidated all the usages of /var/run/python-validity, so that's all neatly contained in one place).

uunicorn commented 1 year ago

Thanks!