about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-02-09 23:06:41 +0000
committerEric Wong <normalperson@yhbt.net>2013-02-11 00:20:18 +0000
commit7d56b023d2aac8530b249b2db7d90a738297a6fc (patch)
tree790209aba835a8fbe707de091a2424603e1e81a4
parent3f454ae96e7cc1352f7bf7756a064cf5781154c4 (diff)
downloadcmogstored-7d56b023d2aac8530b249b2db7d90a738297a6fc.tar.gz
If we receive both SIGUSR2 and SIGQUIT in a short
time period; we should trigger the upgrade before
gsince raceful exit; as no user will (intentionally) send
SIGQUIT before SIGUSR2.
-rw-r--r--cmogstored.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmogstored.c b/cmogstored.c
index d3e8b68..1421afb 100644
--- a/cmogstored.c
+++ b/cmogstored.c
@@ -404,6 +404,8 @@ static void main_worker_loop(const pid_t parent)
         mog_cancel_disable(); /* mog_idleq_wait() now relies on this */
         while (parent == 0 || parent == getppid()) {
                 mog_notify_wait(have_mgmt);
+                if (do_upgrade)
+                        upgrade_handler();
                 if (do_exit)
                         cmogstored_exit();
                 if (have_mgmt)
@@ -416,8 +418,6 @@ static void main_worker_loop(const pid_t parent)
                          * startup, but became usable later
                          */
                         iostat_running = mog_iostat_respawn(0);
-                if (do_upgrade)
-                        upgrade_handler();
         }
 
         syslog(LOG_INFO, "parent=%d abandoned us, dying", parent);