[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.3.2 Running the Server

The server command line has the following general form:

 
moo initial-arguments db-file-name dump-db-file-name network-arguments

The arguments must occur in this order, e.g., a log file name (-l) must come before db-file-name and dump-db-file-name while any port number must come afterwards.

Initial Arguments

-l log-file-name
(Optional) This specifies a file name for the server log output. If no log file name is specified, log output is directed to stderr.

-e
(Optional) This specifies that, once the database is loaded, Emergency Wizard Mode will be entered before starting any tasks or doing the initial listen to accept connections.

Database Arguments

db-file-name
(Required) This should be an existing database file in the appropriate format, whether this be a checkpoint or dump file from a prior run of the server, or one of the many distributed database files in existence (e.g., the `Minimal.db' file provided with the server source distribution).

dump-db-file-name
(Required) This should indicate where to write checkpoint and final dump files. Note that the server does not immediately verify this path, i.e., there is no checking at startup that the file in question is actually writable; in fact, that the directory exists and is writable at the time the dump or checkpoint is attempted is all that really matters.

Network Arguments

The particular set of network arguments available depends on which NETWORK_PROTOCOL the server was compiled with. For a server compiled for single-user mode (NP_SINGLE), there are no additional arguments. For a server compiled for local interprocess communication (NP_LOCAL), there is just

connect-file-name
(Optional) This specifies the pathname for the (UNIX domain) socket or named-pipe that will be used for connecting to the server. If no connect file name is specfied, the compiled-in value of DEFAULT_CONNECT_FILE is used.

For a server compiled for general TCP/IP connections (NP_TCP), we have

-p port-number
(Optional) This specifies an initial port at which to listen for connections once the server successfully starts. If no port number is specfied, the compiled-in value of DEFAULT_PORT is used.

For the sake of backwards compatibility with prior server versions, the -p may be omitted.

-a n.n.n.n

This specifies a local IP address to bind for all listening and all outgoing connection attempts. n.n.n.n must be a valid numeric IP address assigned to one of the local host's network interfaces. If no specific IP address is specified, any listening (be this the initial listen implicit in server startup or any explicit listening invoked by the listen() function) will bind to all IP addresses on all available network interfaces; likewise outgoing connection attempts will use whatever address is available.

This is how, on a host with multiple network interfaces, one makes the server be visible only on one of them. At present, there is no way to specify that the server should bind to a subset of of the available IP addresses having more than one address but less than the entire set available. However, if the operating system offers port-forwarding and network address translation facilities, one can likely use those to achieve a similar effect.

Note that even on hosts with only a single physical network interface, there will typically be multiple logical ones. One may, for example, specify the loopback address (usually 127.0.0.1), forcing the server to use the loopback interface for all connections, thus guaranteeing that only local connections, whether incoming or outgoing, will be possible (and thus acheiving most of the safety of NP_LOCAL or NP_SINGLE without needing specialized clients).

+O
Explicitly enables open_network_connection() but only if the server has been compiled to include support for this function (i.e., OUTBOUND_NETWORK has been #defined).

-O
Explicitly disables open_network_connection(). Any calls to this function will raise E_PERM even if the server has been compiled to support it.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on September, 30 2008 using texi2html