SIP Express Router v0.8.8 - Developer's Guide | ||
---|---|---|
<<< Previous | The Server Startup | Next >>> |
When configured so, SER becomes a daemon during startup. A process is called daemon when it hasn't associated controlling terminal. See function daemonize in file main.c for more details. The function does the following:
chroot is performed if neccessary. That ensures that the server will have access to a particular directory and its subdirectories only.
Server's working directory is changed if the new working directory was specified (usually it is /).
If command line parameter -g was used, the server's group ID is changed to that value.
If command line parameter -u was used, the server's user ID is changed to that value.
Perform fork, let the parent process exit. This ensures that we are not a group leader.
Perform setsid to become a session leader and drop the controlling terminal.
Fork again to drop group leadership.
Create a pid file.
Close all opened file descriptors.
<<< Previous | Home | Next >>> |
Interface Configuration | Up | Module Initialization |