Go to the first, previous, next, last section, table of contents.


Control-struct: ]rootPopenSocket
file: job.t
package: muf
status: tentative
{  [ :socket socket
     :commandline "| pgp -feast pat |"
   | ]rootPopenSocket

The ]rootPopenSocket spawns a host process connected to the Muq server via pipes. The @$S.actingUser must be root to do this.)

The :socket parameter must be a socket; It should be either freshly created See section makeSocket, or else one which has been closed by See section ]closeSocket. Before making this call, you should set the socket's $s.standardInput and $s.standardOutput keys to the message streams which you wish the socket connection to use.

The :commandline parameter may take one of three forms:

:commandline "| srv args"
Subprocess reads from socket, output to /dev/null.
:commandline "srv args |"
Subprocess reads from /dev/null, output to socket.
:commandline "| srv args |"
Subprocess both reads and writes from socket.

Note that in the third case, it is often necessary that the subprocess disable output buffering in order to avoid a deadlock in which it blocks waiting for input while its output sits unsent in its stdio output buffer. Subprocesses written in Perl may disable output buffering by doing

select( (select(STDOUT), $| = 1)[0]);

while subprocesses written in C may disable output buffering by doing

setvbuf( stdout, NULL, _IONBF, 0 );

or simply by using raw write() calls in place of the stdio printf, fprintf ... family of buffered output calls.

In all events, Muq will look for the server in the host directory given by db property .muq$S.srvdir, which is usually muq/srv but may be set to other values by editing the value of srvdir in muq/bin/Muq-config.sh or by using the --srvdir=/var/people/pat/muq/srv commandline switch when invoking Muq.

Security precautions include:

Gory Details

See section ]openSocket.


Go to the first, previous, next, last section, table of contents.