Forever does not kill child process when used with -c
See original GitHub issueI’m trying to run Babel with forever which basically means that I run the following command:
forever start -c "babel-node app.js --experimental --harmony"
Note that “babel-node” is a small wrapper to Node and is supposed to (theoretically) work identically and accept identical commands. Anyways, when the app crashes, forever tries to restart it by killing the process and starting another one.
The problem is, it doesn’t kill the process, and invokes the babel-node app.js
command which creates another instance of Node (which crashes due to port in use
error) and it invokes the command again and again.
If anyone knows how to run Babel (other than via the require hook) along with Forever, let me know!
Issue Analytics
- State:
- Created 9 years ago
- Comments:16 (1 by maintainers)
Top Results From Across the Web
Forever does not kill child process when used with -c #687
The problem is, it doesn't kill the process, and invokes the babel-node app.js command which creates another instance of Node (which crashes due ......
Read more >Child process lives forever - Stack Overflow
I've made a child process management library where the parent process and the child process are monitored due a bidirectional WCF pipe.
Read more >wait() — Wait for a child process to end - IBM
Suspends the calling process until any one of its child processes ends. More precisely, wait() suspends the calling process until the system obtains...
Read more >How kill child process without read() hanging in the parent ...
There is an external program I'm calling from within my C/C++ program, by using fork() and execl(), and also redirecting stdio with dup2() ......
Read more >Chapter 1. introduction to processes - linux-training.be
When starting a new bash you can use echo to verify that the pid from before is the ppid of the new shell....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ericprieto
babel/register
allows you to use babel in subsequent required files. So, let’s say you create astart.js
file which will be your new app starting point, add this to it:Make sure you have babel installed locally via
npm install babel --save
so that the library can be required. The library compiles code at runtime rather than beforehand.babel-node
is basically a neat wrapper for this functionality (compiles at runtime as well).In the start file, you can’t use ES6; however, any file down the road can be. So
app.js
can be fully ES6 with imports, exports, etc.Read the docs on it
Seems like
npm install kexec
just works