Server does not run as a proper daemon
Currently the server runs in the foreground. In order to automate the start and management of a server, it's necessary to wrap it inside something like GNU screen.
A proper daemon implementation would:
1. Fork a process in the background and dissociate from the controlling TTY
2. Close any inherited file handles.
3. Write all data to log files, not to stdout/stderr.
4. Become the session leader / process group leader.
5. Write a PID file.
6. Change the CWD to / (so it doesn't keep any directory tied up when you need to unmount a file system)
7. Drop privileges after listening on required TCP ports.
8. Respond to SIGINT by gracefully shutting down.
9. Possibly implement other control mechanisms, for example:
a. Respond to SIGUSR1 by reloading configurations.
b. Listen on a local port for controlling commands (similar to commands typed into the console today)
2014-08-21, 09:24 PM
2014-08-22, 09:21 AM
2014-08-22, 09:21 AM
0
2
-