Current Version: v8.3.1
Last Version Used in Production: v7.9.21
Visualization Module: Vision
scenario: vision client launches a set of http API drivers on the host machine so it can communicate with various equipment installed on the machine. this strategy cannot be changed at this time due to time constraints. starting of processes from vision clients is no longer working the way it used to in v7.9.21, breaking this setup.
v7.9.21 of Ignition allowed vision clients to launch completely detached processes which would not close when the vision client closed and would work pretty much as if they had been launched by the user. Using the python subprocess module worked without issue.
v8.3.1 seems to have changed something because now processes are being launched as child processes, which close when the vision client closes. After reworking to use java libraries, the processes can be made to start detached, but they still hang or crash for some reason (tested with multiple apps).
import os
from java.lang import ProcessBuilder
from java.io import File
# inputs
filepath = "<path/to/executable>"
minimized = False
fn = os.path.basename(filepath)
dp = os.path.dirname(filepath)
cmds = [
"cmd.exe",
"/c",
"start",
"/B",
]
if minimized:
cmds.append("/MIN")
cmds.append(fn)
pb = ProcessBuilder(cmds)
pb.directory(File(dp))
pb.redirectOutput(File(os.devnull))
pb.redirectError(File(os.devnull))
pb.redirectInput(File(os.devnull))
process = pb.start()
Does anyone know how to fix this / a workaround?