randomstring / weasleyclockd

Python deamon listening for MQTT updates and controlling the motion of a Weasley Clock.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lockfile not removed after unclean shutdown

randomstring opened this issue · comments

The lockfile /home/pi/weasleyclockd/weasleyclock.pid.lock is not deleted if the daemon is not shot down cleanly. For instance if the Raspberry Pi loses power.

Need to investigate the correct way to do this. Some clues:

https://unix.stackexchange.com/questions/256125/whats-the-best-way-to-remove-pid-files-before-starting-a-service
https://pagure.io/python-daemon/issue/4

The '/run/lock' directory is the proper place to put PID lock files. This directory id a tmpfs and is recreated at boot time, clearing the old lock files.