-
Notifications
You must be signed in to change notification settings - Fork 4
/
init.js
35 lines (26 loc) · 980 Bytes
/
init.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// debug top -p `pgrep node | tr "\\n" "," | sed 's/,$//'`
var ProcessManager = require('./ProcessManager/ProcessManager.js');
pm = new ProcessManager();
pm.cleanZombies('HPlayer');
printBlue("starting HPlayer...");
pm.spawn("./bin/HPlayer/bin/HPlayer",[],true,false);
printBlue("starting ScenarioPlayer...");
pm.spawn("node",["./ScenarioPlayer/init.js"],true,false);
printBlue("starting OSCDispatcher...");
pm.spawn("node",["./OSCDispatcher/OSCDispatcher.js"],true,true);
printBlue("starting Webserver...");
pm.spawn("node",["./WebServer/WebServer.js"],true,false);
//printBlue("starting IOInterface...");
//pm.spawn("sudo",["node","./IOInterface/IOInterface.js"],true,true);
process.on('SIGINT', gameover);
process.on('uncaughtException', gameover);
process.on('exit', gameover);
function gameover(code){
pm.cleanZombies('HPlayer');
pm.cleanZombies('node');
//pm.killAll();
//process.exit(0);
}
function printBlue(what){
console.log("\x1B[34m"+what+"\x1B[39m");
}