Semaphores are cool. They are like system-level arrays where you can lock a record. The best part is that the inner workings are black boxed. Ergo, little problematic conditions like race and corruption don't exist. Honestly, I'm winging it, consult a book for specifics.
Lets build some requirements for our daemon.
We should always have a clear view of what we want code. For now, we will just dump it into a log file. Specific implementations are out of the scope of this book. In other words, this program does good stuff, it's up to you take it further. Secondly I want this daemon to respond to signals.