Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NodeJS listen to signal from bash script on some event

Tags:

node.js

Is there any way to nodejs listening for some way of signal that is generated by a bash script on some event random in time?

How can I generate that signal in bash script and listening on nodejs?

Any help is welcome Regards

like image 971
Vitor Avatar asked Feb 29 '12 19:02

Vitor


1 Answers

A node.js process can listen for any POSIX signal. Personally, I use the SIGUSR1 event. Use SIGUSR2.

See http://nodejs.org/docs/latest/api/process.html#signal_Events for more info.

like image 95
danmactough Avatar answered Sep 19 '22 01:09

danmactough