nd 1.0

nd is a small software that allows you to create simple network daemons.
  1 Screenshot
nd is a small software that allows you to create simple network daemons.

Usage: ./nd -p port [OPTIONS]... command...

Listen on a TCP port, executing a command with stdin and stdout redirecting to the incoming connection.

Option Summary:

-p port The port to run the server on.
-a addr The address to ind the server to.
-v Print additional output.
-d Daemonize the server.
-i Block SIGPIPE for child processes.
-l logfile Redirect output to logfile.
-x pidfile Write out the PID of the server to pidfile.
-u user Run child processes as user.
-U user After binding to the address, switch to user.
-k Do not kill child processes when server is killed.
-h Print this help.


A simple daemon can be created like this:

$ nd -p 4000 echo hi

With this running, whenever a client connects they will see the string ’hi’ printed, and then the connection will close.


The following shows how to run nd as a daemon:

$ nd -p 4000 -l log -x pid -d -v echo hi

This will tell nd to daemonize itself. The pid of the daemon will be written to pid and the logging will be redirected to log. The -v parameter increases the verbosity slightly. With one -v parameter, the server startup sequence is logged and an additional log line is written when the server stops.

Stopping nd

nd can be stopped by sending either SIGINT or SIGTERM to the process. SIGINT is usually ^C at a terminal, whereas SIGTERM is the default sent by kill. Note that 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.


The remote port of the client


The remote address of the client


The port nd is bound to


The address nd is bound to


The number of -v parameters passed to nd

What's New in This Release:

Many features were implemented.
IPv6 support is missing.

last updated on:
March 4th, 2008, 9:57 GMT
license type:
GPL (GNU General Public License) 
developed by:
Andrew Madigan
ROOT \ System \ Networking
Download Button

In a hurry? Add it to your Download Basket!

user rating 17



Rate it!

Add your review!