Node.js spawn child process and get terminal output live

It’s much easier now (6 years later)! Spawn returns a childObject, which you can then listen for events with. The events are: Class: ChildProcess Event: ‘error’ Event: ‘exit’ Event: ‘close’ Event: ‘disconnect’ Event: ‘message’ There are also a bunch of objects from childObject, they are: Class: ChildProcess child.stdin child.stdout child.stderr child.stdio child.pid child.connected child.kill([signal]) child.send(message[, … Read more

spawning process from python

As @mark clarified it’s a Linux system, the script could easily make itself fully independent, i.e., a daemon, by following this recipe. (You could also do it in the parent after an os.fork and only then os.exec… the child process). Edit: to clarify some details wrt @mark’s comment on my answer: super-user privileges are not … Read more