aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/unix/main.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-03-21 18:01:48 -0400
committerFlorin Coras <florin.coras@gmail.com>2019-03-21 23:17:51 +0000
commitd1e17d00bb81659bf9e45caa62482bf7029d98f7 (patch)
tree5f50c468a8638b79806da6d4d3dffdc670cd8a06 /src/vlib/unix/main.c
parent9e041b10ee3e6566c7e2ef0c581afafe57569e82 (diff)
Ignore SIGTERM during the vpp boot sequence
Call setjmp and mark the setjmp context valid just prior to entering the vpp main loop. Change-Id: I26d5cd6a624cb2a497d81eb85a62365621b3b469 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vlib/unix/main.c')
-rwxr-xr-xsrc/vlib/unix/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/vlib/unix/main.c b/src/vlib/unix/main.c
index bf66407f0be..fe1f94d52f3 100755
--- a/src/vlib/unix/main.c
+++ b/src/vlib/unix/main.c
@@ -110,11 +110,16 @@ unix_signal_handler (int signum, siginfo_t * si, ucontext_t * uc)
{
/* these (caught) signals cause the application to exit */
case SIGTERM:
- if (unix_main.vlib_main->main_loop_exit_set)
+ /*
+ * Ignore SIGTERM if it's sent before we're ready.
+ */
+ if (unix_main.vlib_main && unix_main.vlib_main->main_loop_exit_set)
{
syslog (LOG_ERR | LOG_DAEMON, "received SIGTERM, exiting...");
unix_main.vlib_main->main_loop_exit_now = 1;
}
+ else
+ syslog (LOG_ERR | LOG_DAEMON, "IGNORE early SIGTERM...");
break;
/* fall through */
case SIGQUIT: