SIGINT is sent twice when pressing Ctrl-C, causing dirty shutdown
See original GitHub issueI have a package.json
with the following scripts:
…
"startemulators": "firebase emulators:start --import seed",
"listen": "onchange 'source_files/*.js' -- touch functions/index.js",
"emulate": "concurrently \"npm run startemulators\" \"npm run listen\""
…
Running the emulate
script works as expected, but pressing Ctrl-C to shut the processes down gives me this:
[0] i emulators: Received SIGINT (Ctrl-C) for the first time. Starting a clean shutdown.
[0] i emulators: Please wait for a clean shutdown or send the SIGINT (Ctrl-C) signal again to stop right now.
[0] i emulators: Shutting down emulators.
[0] i ui: Stopping Emulator UI
[0] ⚠ Emulator UI has exited upon receiving signal: SIGINT
[0] i functions: Stopping Functions Emulator
[0] i hosting: Stopping Hosting Emulator
[0] i database: Stopping Database Emulator
[1] npm run listen exited with code 0
[0]
[0] ⚠ emulators: Received SIGINT (Ctrl-C) 2 times. You have forced the Emulator Suite to exit without waiting for 3 subprocesses to finish.
So for some reason, a second SIGINT is sent to the firebase
command specified in the first script. How come?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:18 (1 by maintainers)
Top Results From Across the Web
Why should SIGINT be triggered twice to work as expected?
First Ctrl-C sends SIGINT to process, your program has a callback 'handler' for SIGINT processing, so your program won't quit.
Read more >why would typing Ctrl+c twice stop a running process in Linux?
If a second Ctrl + C doesn't kill the program, try Ctrl + \ , which sends SIGQUIT, a more violent (but still...
Read more >Chapter 2 - Sockets and Patterns - ZeroMQ guide
You can then send the message twice (or more, if you create more copies) and the message will only be finally destroyed when...
Read more >virsh - management user interface - manpages.ubuntu!
Most virsh commands act synchronously, except maybe shutdown, setvcpus and setmem. ... Another option is to send SIGINT (usually with "Ctrl-C") to the...
Read more >Cisco IOS Configuration Fundamentals Command Reference
To configure the default frequency time to scan modem signals, ... error code 0 sending SHUTDOWN FDIAG_QUIT to fdiag in slot 3 Board...
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 Free
Top 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
Running into this problem myself, here’s a bit from my
package.json
:If I run
npm run serve
and then press Ctrl+C the Firebase emulators see double SIGINT signals and shutdown without exporting data.Hi,
I have the same problem and investigated a little bit. By commenting out that line, I ended up with something working correctly, no double
SIGINT
, everything is cool.It looks like
spawn-command
does not spawn the subprocess in detached mode, and it seems the defaults in concurrently are not setting detached options neither. Because if not, it’s perfectly normal to have theSIGINT
sent twice, because it’s received by the subprocess, and then resent withcommand.kill(signal)
a second time.