From 28896041f321a70344971ed6b0bc1a649eeff713 Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Tue, 19 Feb 2019 01:17:34 +0000 Subject: [ipxe builder] Add cancel button for the ipxe building process, limit log to 500 lines --- server/lib/shell.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'server/lib/shell.js') diff --git a/server/lib/shell.js b/server/lib/shell.js index 8d609e4..81d3008 100644 --- a/server/lib/shell.js +++ b/server/lib/shell.js @@ -61,19 +61,11 @@ module.exports = { shell.mv(path.join(__appdir, 'ipxe', 'undionly.kpxe'), path.join(__appdir, 'ipxe', 'ipxe.' + ipxeVersion)) }, - stopBuilding: async function (req, res) { - // TODO: KILLING IS NOT WORKING.. fml + cancelBuilding: async function (req, res) { const process = make[req.params.version] - console.log(process) if (process) { - console.log('KILLING IT °_°') - // process.stdin.pause() - // shell.kill(process.pid, 'SIGINT') - // const kill = 'kill -2 ' + process.pid - // console.log(kill) - // shell.exec(kill) - // process.kill("SIGINT") - // child.exec("kill -2 " + process.pid) + const kill = 'pkill -P ' + process.pid + shell.exec(kill) } res.send({ status: 'SUCCESS', data: process }) }, -- cgit v1.2.3-55-g7522