diff --git a/config.cli.js b/config.cli.js index f16b25fc..e2d6733c 100644 --- a/config.cli.js +++ b/config.cli.js @@ -161,6 +161,13 @@ if (argv.rtorrent) { const rTorrentProcess = spawn('rtorrent', args.concat(['-o', opts])); + rTorrentProcess.on('close', () => { + process.exit(); + }); + rTorrentProcess.on('error', () => { + process.exit(); + }); + process.on('exit', () => { console.log('Killing rTorrent daemon...'); rTorrentProcess.kill('SIGTERM');