D
likely stands for debug, though no indication of its intent was provided by the developer when adding it (possibly on behalf of another):
commit 88eecaf68174e4e0190e2b866e0bcb59b81b6061
Author: raj <raj@5bbd99f3-5903-0410-b283-f1d88047b228>
Date: Mon Jul 11 21:58:41 2011 +0000
massive re-write of src/netserver.c to clean out old spaghetti allow multiple listen sockets for control and run netserver without daemonizing or spawning children to avoid fork calls which may not sit well with various bypass libraries. this has probably broken the Windows code and perhaps other platforms as well but it has been tested under linux
Use the source (i.e., read netserver.c
):
case 'D':
/* perhaps one of these days we'll take an argument */
want_daemonize = 0;
not_inetd = 1;
break;
The first variable want_daemonize
is used in the same file to control whether the program puts itself into the background:
/* we are the top netserver process, so we have to create the
listen endpoint(s) and decide if we want to daemonize */
setup_listens(local_host_name,listen_port,local_address_family);
if (want_daemonize) {
daemonize();
}
accept_connections();
The other variable, not_inetd
controls whether it attempts to open a socket to the inetd
service.
The developers probably had in mind the longstanding behavior of other programs, e.g., as described in this 2002 section 29.2.1 Invoking a standalone service (although in effect reversing the sense of the option):
Try the following (alternative commands in parentheses):
/usr/sbin/in.ftpd -D
( /usr/sbin/in.wuftpd -s )
The -D
option instructs the service to start in Daemon mode (or standalone mode). This represents the first way of running an Internet service.
netserver -h
) where you say "no indication" because he says it: and run netserver without daemonizing or spawning children to avoid fork calls. Merging these two answers would be a useful addition to thenetserver
documentation :-) – Rich Oct 08 '20 at 22:00