NEXT UP previous
Next: Practice

Principles

There are several ways to start up a daemon. The most common are:

In order to be completely sound, a daemon should be capable of being executed correctly in all of these ways. The only problem is that some of these startup methods leave the daemon in a vulnerable state, where it can be influenced by the environment that was set up on its behalf before it was run. Much of the code that you will write to convert an ordinary program (such as the example socket server given earlier) into a daemon will be concerned with isolating your program from these influences. In addition to this, program code intended for daemon use will usually have to be more robust than ordinary user code. This is because you will often want to program a daemon so that even if system errors of various types occur while the daemon is running they do not cause the program to crash.


NEXT UP previous
Next: Practice