# $Id$ A daemon for mapping Unix shell commands to XML-RPC functions. NOTE: you need to configure these defaults: SxRegistryComponentUser SxRegistryComponentPassword on NSGlobalDomain to make registration of other services work. How it works ============ A unix command is very similiar to an XML-RPC function, it has input parameters, it has a result and it has a name. Additionally a unix command has input, output and error streams as well as possible input and output files. All the IO options of an Unix command need to be mapped to XML-RPC parameters and results. Sample: mapping the Unix find command ===================================== Find takes it's parameters on the command line and delivers the result on the stdout stream. Error codes are returned using the exit status and error messages on the stderr stream. Unix call: find / -name "*a*" -type d XML-RPC Function: Array com.skyrix.system.find(String root, name, type) Mapper: com.skyrix.system.find = { executable = "/usr/bin/find"; signatures = { ( String ) = { cmdline = "$0"; }; ( String, String ) = { cmdline = "$0 -name $1"; }; ( String, String, String ) = { cmdline = "$0 -name $1 -type $2"; }; }; result = { value = ""; type = "arrayOfLines"; }; fault = { code = "$$"; message = ""; }; }; Sample: mapping the Unix eval command ===================================== Unix call: echo "1+2/3" | bc XML-RPC Function: Object com.skyrix.system.bc(String statements) Object com.skyrix.system.bc(i4 a, i4 b) Mapper: com.skyrix.system.bc = { executable = "/usr/bin/bc"; signatures = { ( String ) = { stdin="$0\n"; }; ( i4, i4 ) = { stdin="$0$ + $1$\n"; }; }; result = { value = ""; type = "string"; }; fault = { code = "$$"; message = ""; }; };