OPTION(rgw_cache_enabled, OPT_BOOL, true) // rgw cache enabled
OPTION(rgw_cache_lru_size, OPT_INT, 10000) // num of entries in rgw cache
OPTION(rgw_socket_path, OPT_STR, "") // path to unix domain socket, if not specified, rgw will not run as external fcgi
+OPTION(rgw_host, OPT_STR, "") // host for radosgw, can be an IP, default is 0.0.0.0
+OPTION(rgw_port, OPT_STR, "") // port TCP to listen, format as "8080" "5000", if not specified, rgw will not run as external fcgi
OPTION(rgw_dns_name, OPT_STR, "")
OPTION(rgw_script_uri, OPT_STR, "") // alternative value for SCRIPT_URI if not set in request
OPTION(rgw_request_uri, OPT_STR, "") // alternative value for REQUEST_URI if not set in request
if (chmod(path, 0777) < 0) {
dout(0) << "WARNING: couldn't set permissions on unix domain socket" << dendl;
}
+ } else if (!g_conf->rgw_port.empty()) {
+ string bind = g_conf->rgw_host + ":" + g_conf->rgw_port;
+ sock_fd = FCGX_OpenSocket(bind.c_str(), SOCKET_BACKLOG);
+ if (sock_fd < 0) {
+ dout(0) << "ERROR: FCGX_OpenSocket (" << bind.c_str() << ") returned " << sock_fd << dendl;
+ return;
+ }
}
m_tp.start();
CINIT_FLAG_UNPRIVILEGED_DAEMON_DEFAULTS);
if (g_conf->daemonize) {
- if (g_conf->rgw_socket_path.empty()) {
- cerr << "radosgw: must specify 'rgw socket path' to run as a daemon" << std::endl;
+ if (g_conf->rgw_socket_path.empty() and g_conf->rgw_port.empty()) {
+ cerr << "radosgw: must specify 'rgw socket path' or 'rgw port' to run as a daemon" << std::endl;
exit(1);
}