shelljs.exec(`sudo pkill -P ${process.pid}` did not work in ubuntu

225 views Asked by At

I have a python module that work with webcam by opencv in ubuntu. I should execute it from nodejs so I use shelljs package and run shell.exec('sudo pkill -P ${pythonProcess.pid}'). It does not close webcam otherwise it working in terminal of ubuntu. I type sudo pkill -P <PID> in terminal and process is terminated and close webcam immediately. anybody has any idea why? tnx.

0

There are 0 answers