Initialization
Prior to starting the daemons, the srv command defines its name space according to the specification in file server/namespace (relative to the current directory). See newns - build a new name space from a description file in Chapter 15 for the specification format.
The srv command also starts the connection service for resolving network addresses. See cs - start connection server daemon command.
File Service
The srv command spawns a thread that monitors requests on the styx service port. For each incoming request, yet another thread is spawned to authenticate the connection and provide access to the local file system. See dial, announce, export, listen - make network connections in Chapter 8 for the discussion of the export function.
Remote Execution Services
Among the daemons created by the srv command is a thread that monitors requests on service port rstyx. These requests represent requests by clients for commands to be executed on the server.
Each incoming request is logged to the server's console. The message includes the client's network address.
Line 1
|
A decimal integer representing the number of bytes in the following line.
|
Line 2
|
The command and arguments, if any to be executed on the server.
|
The client's commands are executed with the same Inferno user ID that was used when the srv command was issued.
Termination
Once the daemons have been started, the srv command starts the Inferno shell (see sh - command line interface to the Inferno system in Chapter 5) to process command line input. The srv command does not terminate.