Seherd
This daemon is attached to a database and a ivtv tuner/capture card. Multiple instances can exist, each attached to a specific tuner card. Jobs are taken from the tuner card's job queue for processing based on what time it is. The current job is placed in the database as well so that the backend knows what this daemon is doing currently.
On SIGHUP, the daemon quits the current job (without destroying what was currently done or putting it back in the queue!) and gets the next job it should work on.
On SIGTERM, the daemon quits all jobs, cleans up, and quits.
The daemon knows how to tune the tuner appropriately and where to put the resulting file. It holds a lock on the file's record so it cannot be deleted while being recorded. It can be watched.
If we run out of space, the daemon waits for more space to become available and will continue at that time. All file movement/deletion is handled by the backend, not this daemon, if space is gone.