diff options
author | Dave Barach <dave@barachs.net> | 2019-03-21 18:01:48 -0400 |
---|---|---|
committer | Yichen Wang <yicwang@cisco.com> | 2019-03-25 23:08:09 +0000 |
commit | 327fbae5959f52c7fe670d8d204faaf2c8781a17 (patch) | |
tree | d69b004fece348badcd55e66e132c86c12fefc02 /src/vlib/unix | |
parent | 0d961549c08ccc6d25cf384fdc8a1c982384219e (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>
(cherry picked from commit d1e17d00bb81659bf9e45caa62482bf7029d98f7)
Diffstat (limited to 'src/vlib/unix')
-rwxr-xr-x | src/vlib/unix/main.c | 7 |
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: |