aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/unix/main.c
diff options
context:
space:
mode:
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 08f0506fbc2..c0e6770290f 100755
--- a/src/vlib/unix/main.c
+++ b/src/vlib/unix/main.c
@@ -104,11 +104,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: