Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

104
Views
Javascript child process kill not stopping -

I am trying to stop a child-process in js, the problem is that it just ignores the stop call. This is the code:

var child = null

child = child_process.spawn("webtorrent --vlc magnet:?xt=urn:btih:414A6F933C48FC7543A9CDB42C854B5457C5BCC7&dn=Avengers%3A+Endgame+%282019%29+%5BWEBRip%5D+%5B1080p%5D+%5BYTS%5D+%5BYIFY%5D&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969%2Fannounce&tr=udp%3A%2F%2F9.rarbg.com%3A2710%2Fannounce&tr=udp%3A%2F%2Fp4p.arenabg.com%3A1337&tr=udp%3A%2F%2Ftracker.internetwarriors.net%3A1337&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.zer0day.to%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969%2Fannounce&tr=udp%3A%2F%2Fcoppersurfer.tk%3A6969%2Fannounce", undefined, {
  encoding: 'utf8',
  shell: true
});

child.stdout.on('data', (data) => {
  //Here is the output
  data=data.toString();
  
  console.log(data)
});


setTimeout(function() {
  console.log('Killing Your child', child.pid);
  child.kill()
}, 5 * 1000);

I don't think it has to do with it, but the command I'm running runs with webtorrent, Web torrent-client is a torrent, that can download magnet links: https://www.npmjs.com/package/webtorrent-cli

the timeout runs after 5 seconds, it logs the message but never stops the process

I tried using tags inside the kill() like: "SIGINT" or "SIGKILL"

I tried running without the timeout too...

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!