summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_main.cc
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@redhat.com>2016-04-22 19:21:33 +0200
committerCasey Bodley <cbodley@redhat.com>2016-05-17 22:00:13 +0200
commitc4c2942d98670d66d2e8931fd4a4ded82188d7bb (patch)
treee639ebb7ef7eed1d6cd06a502b48984f0b1855ea /src/rgw/rgw_main.cc
parentMerge pull request #9026 from badone/wip-log-syslog-info (diff)
downloadceph-c4c2942d98670d66d2e8931fd4a4ded82188d7bb.tar.xz
ceph-c4c2942d98670d66d2e8931fd4a4ded82188d7bb.zip
rgw: extend SIGHUP handler for realm reconfiguration
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com> Signed-off-by: Casey Bodley <cbodley@redhat.com>
Diffstat (limited to 'src/rgw/rgw_main.cc')
-rw-r--r--src/rgw/rgw_main.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc
index b5adf5ebd25..29e2a048933 100644
--- a/src/rgw/rgw_main.cc
+++ b/src/rgw/rgw_main.cc
@@ -177,6 +177,19 @@ static RGWRESTMgr *set_logging(RGWRESTMgr *mgr)
void intrusive_ptr_add_ref(CephContext* cct) { cct->get(); }
void intrusive_ptr_release(CephContext* cct) { cct->put(); }
+RGWRealmReloader *preloader = NULL;
+
+static void reloader_handler(int signum)
+{
+ if (preloader) {
+ bufferlist bl;
+ bufferlist::iterator p = bl.begin();
+ preloader->handle_notify(RGWRealmNotify::Reload, p);
+ }
+ sighup_handler(signum);
+}
+
+
/*
* start up the RADOS connection and then handle HTTP messages as they come in
*/
@@ -370,7 +383,7 @@ int main(int argc, const char **argv)
}
init_async_signal_handler();
- register_async_signal_handler(SIGHUP, sighup_handler);
+ register_async_signal_handler(SIGHUP, reloader_handler);
register_async_signal_handler(SIGTERM, handle_sigterm);
register_async_signal_handler(SIGINT, handle_sigterm);
register_async_signal_handler(SIGUSR1, handle_sigterm);
@@ -425,6 +438,8 @@ int main(int argc, const char **argv)
RGWFrontendPauser pauser(fes, &pusher);
RGWRealmReloader reloader(store, &pauser);
+ preloader = &reloader;
+
RGWRealmWatcher realm_watcher(g_ceph_context, store->realm);
realm_watcher.add_watcher(RGWRealmNotify::Reload, reloader);
realm_watcher.add_watcher(RGWRealmNotify::ZonesNeedPeriod, pusher);
@@ -452,7 +467,7 @@ int main(int argc, const char **argv)
delete fec;
}
- unregister_async_signal_handler(SIGHUP, sighup_handler);
+ unregister_async_signal_handler(SIGHUP, reloader_handler);
unregister_async_signal_handler(SIGTERM, handle_sigterm);
unregister_async_signal_handler(SIGINT, handle_sigterm);
unregister_async_signal_handler(SIGUSR1, handle_sigterm);