NAME
|
cmdfs – command execution file system |
SYNOPSIS
|
cmdfs [ –abcd ] [ –s srv ] [ –m mnt ] |
DESCRIPTION
|
Cmdfs provides a way to run rc(1) commands through a file system
interface and provides means to customize the name space for the
commands. It serves a two–level directory and mounts itself by
default at /mnt/cmd and at mnt under option –m. A connection to
the file system is posted at /srv/cmdfs or at srv
under option –s. Flags –abc are similar to those of bind(1). Flag
–d enables debug diagnostics and may be repeated to increase verbosity.
The top of the hierarchy is a directory that contains a clone
file and one more directories per existing command. Each command
directory contains several files: Opening the clone file creates a command and returns an open file descriptor for its ctl file. Reading from it a first time would return the name of the directory for the command. Before executing a command, its stdin, stdout, and stderr files may be open to connect to its I/O descriptors and its wait file may be open to read later from it and await for command completion.
Once appropriate files have been open, the following control requests
may be issued to the control file:
Reading the ctl file reports the command directory name, the status
string (either born, exec, or dead), the PID for the command in
the Plan 9 system, and the first argument (the name of the command). |
SOURCE
|
/sys/src/cmd/cmdfs.c |
BUGS
|
The chdir control request does not report errors. It would be
better to adjust the name space per–command and not using the one
of the entire file system. |