Hardware Reference
In-Depth Information
Using the
cdplayer
example again, the remote machine processes a command that now looks like this, if it were
to be processed locally:
cdplayer localhost play 1
Bearskin Compatibility
To make your own commands compatible with Marple, you need to begin your scripts with a few extra lines of code.
Here's an example:
DEVICE=`$MINBIN/finddev mixer $*ยด
if [ $? == 0 ]; then
echo $DEVICE
exit 0;
fi
This rather strange-looking piece of code makes use of both the
finddev
output and its exit code. It returns a 0 in
those cases where the device name was found but wasn't intended for this machine. In other words, it has dispatched
a SOAP request or similar and 1 when a genuine device was found. The latter is more usual and ends up being
/dev/dsp
or similar. As far as the command scripts go, this is all that's necessary.
The extra work comes from creating a local
devlist
. But each is generally a carbon copy of the others. Namely,
a file called
$MINBASE/etc/devices/new_app_name/devlist
should be created and appear like this, replacing
/dev/dvd
with a suitable device for your app:
localhost dev /dev/dvd - -
default dev /dev/dvd - -
Note that the local
devlist
file should always include a
default
and
localhost
reference. This ensures that
every query can terminate and stops recursive loops from happening.
N
Some low-level software, such as the CD player program
cdcd
, requires
$HOME
to be set up before the program
can be run. This requires the machine charged with processing SOAP requests to add this extra line of code
and sometimes prepare a
.cdcdrc
file in the home directory of the
www-data
user.
Note
Utility Scripts
A quick perusal of the
$MINBASE/bin
directory will reveal a number of commands that haven't yet been covered.
These divide into status and user tools.
Status
These are the simplest to consider and are basic scripts that perform read-only tasks to report on the various
elements of the system. Because of the architecture, this is usually nothing more complex than reading text files in
the
/var/log/minerva
directory or querying the existing commands.
Search WWH ::
Custom Search