How can I spawn a process when using WindX and SSH

Started by PxPlus, July 12, 2018, 10:14:05 AM

Previous topic - Next topic

PxPlus

Because SSH effectively requires a user to log on to the Unix/Linux system, spawning a session when you are connected using SSH requires some special settings.
This would also be required when using the report viewer *viewer* as it spawns a process.

Basically you have two choices -- both of which are controlled by setting the global variable %PXPLUS_HOST$ prior calling *windx.utl;spawn.


  • You can run *plus/cs/host in the background on your server and set %PXPLUS_HOST$ to your servers IP address - semi-colon, port number (e.g. "192.168.1.123;4093"). This will cause *windx.utl to connect to the CS host, have it spawn a task, and then connect to it.
    Note: The spawned task will run under whatever userid *plus/cs/host was launched under.

  • You can set %PXPLUS_HOST$ to an asterisk (*) followed by the same host address, semi-colon, and port. In this case you don't need to run *plus/cs//host as your application itself will spawn the process and connect to it. This will preserve the userid and other environmental settings in the spawned process.
The challenge is to make sure the host address you use is the host address as seen by the workstation.  For example if your host server is connected to the internet using a router and the workstation will be coming in from outside, then the IP address will need to be the external address and not internal address.


Note: In both cases you will need to make sure whatever port you use is accessible from the workstation and not blocked by a firewall.