This software enables users to easily produce basic network daemons. Its compact design makes it practical for a range of applications.
Other options include -a addr, which you can use to indicate the address to bind the server to. If you want to print additional output, you can use the -v option. The -d option is used to daemonize the server, while the -i option is used to block SIGPIPE for child processes.
The -l logfile option redirects output to logfile, while the -x pidfile option writes the PID of the server to pidfile. The -u user option runs child processes as the specified user. If you want to switch to a user after binding to the address, you can use the -U user option. The -k option is used to prevent the killing of child processes when the server is killed, and the -h option prints the help menu.
For example, you can create a simple daemon by running $ nd -p 4000 echo hi. With this running, clients that connect will see the string 'hi' printed, and then the connection will close.
To run nd as a daemon, use $ nd -p 4000 -l log -x pid -d -v echo hi. This will daemonize nd, and the logging will be redirected to log. With one -v parameter, the server startup sequence is logged, and an additional log line is written when the server stops.
You can stop nd by sending either SIGINT or SIGTERM to the process. These will also stop any running child processes unless -k was passed to nd at startup.
The following environment variables are set for child processes: ND_PORT, ND_ADDR, ND_LISTEN_PORT, ND_LISTEN_ADDR, and ND_VERBOSITY.
In this release, many features have been implemented, but IPv6 support is missing.
Version 1.0: N/A