Some notes about the target agent
=================================

General
-------

The target agent is the SCR interface to (shell) commands
of the target system.

It is used as a replacement for the WFM Shell()/Mkdir()/Symlink() (etc.)
builtins, which were wrong in the first place. Since the WFM isn't
necesseraly running on the target system, the builtins of WFM might
run on the wrong system.

Paths
------
The Target agent is mounted to the '.target' path of the SCR
namespace.

Implemented paths are

Execute (.target.bash, string command [, map env])	execute command in bash
Execute (.target.bash_output, string command [, map env]) execute command in bash, return output
Execute (.target.bash_background, string command [, map env]) execute command in bash, don't wait for return
Execute (.target.symlink, string old, string new)	create symbolic link
Execute (.target.mkdir, string dir [, integer mode])	create directory (with mode)
Execute (.target.remove, string file)			remove file
Execute (.target.inject, string file, string path)	inject file to target system
Execute (.target.control.printer_reset, string device)	reset a printer device

Execute (.target.mount, ...)
Execute (.target.umount, ...)
Execute (.target.smbmount, ...)
Execute (.target.insmod, ...)
Execute (.target.modprobe, ...)

The Target agent implements the Execute() interface of SCR,
so a typical call for the target agent would be

SCR (`Execute (.target.bash, "command_to_run_in_bash", $[ "env":"value"] ));
SCR (`Execute (.target.symlink, "oldpath", "newpath" );
SCR (`Execute (.target.mkdir, "path" );	// default mode is 0755
SCR (`Execute (.target.control.printer_reset, "/dev/lp1");
SCR (`Execute (.target.bash, "command_to_run_in_bash", $[ "env":"value"] ));

Further interfaces are Read() and Write() which are used for file access.

(Replaces WFM Read/Write)
Read(.target.file, ...)
Write(.target.file, ...)

(Replaces WFM ReadY2/WriteY2)
Read(.target.ycpfile, ...)
Write(.target.ycpfile, ...)

Read(.target.root)
Read(.target.tmpdir)
Read(.target.string, ...)
Read(.target.dir, ...)
Read(.target.size, ...)

Details
-------
return from .target.bash_output:
      $[ "exit"   : return_value,            // integer
         "stdout" : "stdout_from_command",   // string
         "stderr" : "stderr_from_command"    // string
      ]

Logging
-------
The logging is controled by Y2DEBUG environment variable.
Set it to "1" and all messages will go to the y2log file.

You can also control the logging with ~/.yast2./logcontrol.ycp
file. Use "bash" as component name.
