Using exec, How the mcc handles commands, Consolidation of windows nt consoles via vnc – Visara Master Console Center Administration Guide User Manual
Page 98
Visara Master Console Center
98
© Visara International 2007
Use exec to have ksh execute the command without forking. This can be
included in the script or in the comand as shown in the preceding example. For
additional examples, refer to examples/commandconsoles/reuse-netscape and
examples/commandconsoles/launch-x-vnc.
Include the command in a script that forwards signals to the child process.
Refer to examples/commandconsoles/map-signals for an example script.
Using Exec
In most cases, exec can be specified in the command. This technique minimizes
the number of processes and may improve signal handling. Every command is
started as “/bin/ksh/ -c command”, and can equally well be started as “/bin/ksh –c
exec command”. However, exec cannot be used if the command has shell-specific
operations. For example, the following command cannot not be used with exec:
ENVVAR=value printenv
Instead, use the following:
Export ENVVAR=value; exec printenv
How the MCC handles Commands
Processes are fork()ed and exec()ed as '/bin/ksh', '-c', ‘
The command does no substitution of any text or variables, and no additional
arguments are provided.
The child process has the same environment as the parent process, including
environment variables, stdout, and stderr.
The MCC attempts to kill child processes by sending a HUP signal to each
child process when the gwconsole process exits when the user logs out. There
may be cases where gwconsole is killed before it completes this action, for
example, if the user exits an X session without logging out of MCC. The specified
command can take actions that would circumvent the MCC from knowing the
application process, and/or preventing the killing of the application with a
SIGHUP.
Each command is responsible for preventing multiple windows for the same
console for a user. The command is also responsible for preventing concurrent
access by multiple users.
Consolidation of Windows NT Consoles via VNC
Note: Visara does not support or resell VNC. It is freeware available
from and supported by the vendor, AT&T. Visara makes the
customer aware of the VNC product, and the customer assumes all
risks associated with the implementation of VNC-based solutions.