I am having some issues getting spawn()
from the system/child_process
SDK module to execute a command successfully on Centos 6.6. I am calling it as
let result = child_process.spawn(command, args, options)
Watching in the debugger, I see that after this step that result
contains properties killed: false
, exitCode: 0
, and a plausible value for the pid
. However, I can’t see any evidence that the command was actually executed. I tried running a command that would touch a file and no file was created. I tried running /bin/uname
and catching stdout
as illustrated in the example here: https://developer.mozilla.org/en-US/Add-ons/SDK/Low-Level_APIs/system_child_process but my callback was not called. I tried making the command /bin/sleep
and the argument 60, but when I checked with ps
the pid
shown in result
was not associated with any active process. If I change command
to something invalid, result
changes to having an exitCode
of -1 and the console shows a “File not found” error, so spawn
is doing something.
I tried using child_process.spawn
on Arch Linux and it worked for me there. What could be different? What could I do to debug this? I’m not seeing any error message.