问题
Program called to run via wine within a node.js script freezes as soon as it starts to do it's task.
This is the top
output:
It runs fine and display the cli's header if I call it without parameters.
But if use it with arguments it hangs as soon as it starts to display progress and continuous stdout (eg: the ones where the only thing that is updated in the screen is the percentage of the current task)
Tried with exec
, execSync
, spawnSync
, spawn
.
Also tried to spawn
and spawnSync
a .sh file calling it (with and without &
disown
)
I think it has something to do with some child_process or even environment limitations, because I was able to do it by calling wine from a new gnome-terminal with parameters. But then I get an extra terminal window popping up, and no control whatsoever about the task conclusion.
Does anyone have a solution or a workaround for this?
回答1:
It was related to stdio
No idea why, but setting
{stdio: ['inherit', 'pipe', 'pipe']}
to .spawn()
for Ubuntu and OSX did the trick.
来源:https://stackoverflow.com/questions/49054520/program-called-to-run-via-wine-within-a-node-js-script-freezes