I need to send a KILL signal to a process using GLib and Javascript, but I’m unable to find how to do it. In C and Vala I can use the Posix calls, but AFAIK, they aren’t available in Javascript. I even tried to do it using “brute force”, with spawn_sync() passing “/bin/kill” and the pid, but I receive an odd message: if I try to kill the pid 7243, I receive:
There doesn’t seem to be anything like an os module for gjs, so I guess /bin/kill is your best option. How are you executing it exactly? In the interpreter, this works as expected: