summaryrefslogtreecommitdiffstats
path: root/server/lib/shell.js
diff options
context:
space:
mode:
authorJannik Schönartz2019-02-19 02:17:34 +0100
committerJannik Schönartz2019-02-19 02:17:34 +0100
commit28896041f321a70344971ed6b0bc1a649eeff713 (patch)
tree912794d9dc05df9381376f9abd911f73c969e92b /server/lib/shell.js
parent[permissionmanager] Change recursive selection, fix layout/table issues (diff)
downloadbas-28896041f321a70344971ed6b0bc1a649eeff713.tar.gz
bas-28896041f321a70344971ed6b0bc1a649eeff713.tar.xz
bas-28896041f321a70344971ed6b0bc1a649eeff713.zip
[ipxe builder] Add cancel button for the ipxe building process, limit log to 500 lines
Diffstat (limited to 'server/lib/shell.js')
-rw-r--r--server/lib/shell.js14
1 files changed, 3 insertions, 11 deletions
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 })
},