irods
4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
![]() ![]() |
#include "rcMisc.h"
#include "initServer.hpp"
#include "rodsConnect.h"
#include "procLog.h"
#include "resource.hpp"
#include "rsGlobalExtern.hpp"
#include "rcGlobalExtern.h"
#include "genQuery.h"
#include "rsIcatOpr.hpp"
#include "miscServerFunct.hpp"
#include "getRemoteZoneResc.h"
#include "getRescQuota.h"
#include "physPath.hpp"
#include "rsLog.hpp"
#include "sockComm.h"
#include "irods_stacktrace.hpp"
#include "rsGenQuery.hpp"
#include "rsExecCmd.hpp"
#include "irods_get_full_path_for_config_file.hpp"
#include "irods_configuration_parser.hpp"
#include "irods_resource_backport.hpp"
#include "irods_log.hpp"
#include "irods_exception.hpp"
#include "irods_threads.hpp"
#include "irods_server_properties.hpp"
#include "irods_random.hpp"
#include <vector>
#include <set>
#include <string>
#include <fstream>
#include <boost/filesystem.hpp>
#include <boost/format.hpp>
#include <boost/optional.hpp>
#include <boost/system/error_code.hpp>
Go to the source code of this file.
Functions | |
int | initServerInfo (int processType, rsComm_t *rsComm) |
int | initLocalServerHost () |
int | initRcatServerHostByFile () |
int | initZone (rsComm_t *rsComm) |
int | initAgent (int processType, rsComm_t *rsComm) |
void | cleanup () |
void | cleanupAndExit (int status) |
void | signalExit (int) |
void | rsPipeSignalHandler (int) |
int | initHostConfigByFile () |
int | initRsComm (rsComm_t *rsComm) |
void | daemonize (int runMode, int logFd) |
int | logFileOpen (int runMode, const char *logDir, const char *logFileName) |
int | initRsCommWithStartupPack (rsComm_t *rsComm, startupPack_t *startupPack) |
std::set< std::string > | construct_controlled_user_set (const std::unordered_map< std::string, boost::any > &controlled_user_connection_list) |
int | chkAllowedUser (const char *userName, const char *rodsZone) |
int | setRsCommFromRodsEnv (rsComm_t *rsComm) |
int | queAgentProc (agentProc_t *agentProc, agentProc_t **agentProcHead, irodsPosition_t position) |
int | purgeLockFileDir (int chkLockFlag) |
Variables | |
static time_t | LastBrokenPipeTime = 0 |
static int | BrokenPipeCnt = 0 |
int chkAllowedUser | ( | const char * | userName, |
const char * | rodsZone | ||
) |
Definition at line 1008 of file initServer.cpp.
References construct_controlled_user_set(), terminate_irods_processes::e, irods::get_server_property(), INVALID_ANY_CAST, KEY_NOT_FOUND, irods::log(), LOG_ERROR, NULL, rodsLog(), and SYS_USER_NOT_ALLOWED_TO_CONN.
Referenced by readWorkerTask(), and runIrodsAgentFactory().
void cleanup | ( | ) |
Definition at line 550 of file initServer.cpp.
References irods::CFG_SERVICE_ROLE_PROVIDER(), closeAllL1desc(), disconnectAllSvrToSvrConn(), disconnectRcat(), get_catalog_service_role(), INITIAL_DONE, InitialState, irods::log(), irods::error::ok(), PASS, irods::re_plugin_globals, and ThisComm.
Referenced by cleanupAndExit(), and runIrodsAgentFactory().
void cleanupAndExit | ( | int | status | ) |
Definition at line 571 of file initServer.cpp.
References cleanup(), LOG_NOTICE, rodsLog(), and irods.pypyodbc::status.
Referenced by rsPipeSignalHandler(), runIrodsAgentFactory(), signalExit(), and xmsgServerMain().
std::set<std::string> construct_controlled_user_set | ( | const std::unordered_map< std::string, boost::any > & | controlled_user_connection_list | ) |
Definition at line 993 of file initServer.cpp.
References terminate_irods_processes::e, INVALID_ANY_CAST, KEY_NOT_FOUND, and THROW.
Referenced by chkAllowedUser().
Definition at line 762 of file initServer.cpp.
References SINGLE_PASS, and STANDALONE_SERVER.
Referenced by main().
Definition at line 463 of file initServer.cpp.
References AGENT_PT, applyRule(), authInfo_t::authFlag, userInfo_t::authInfo, rsComm_t::clientUser, thread_context::cond, rsComm_t::cookie, GlobalQuotaLimit, GlobalQuotaOverrun, initExecCmdMutex(), initFileDesc(), INITIAL_DONE, InitialState, initL1desc(), initProcLog(), initServerInfo(), initSpecCollDesc(), int(), LOCAL_PRIV_USER_AUTH, thread_context::lock, LOG_ERROR, NO_SAVE_REI, NULL, ProcessType, RECONN_TIMEOUT, rsComm_t::reconnAddr, rsComm_t::reconnFlag, reconnManager(), rsComm_t::reconnPort, rsComm_t::reconnSock, thread_context::reconnThr, RESC_QUOTA_UNINIT, RescQuotaPolicy, rodsLog(), RuleExecInfo::rsComm, irods.pypyodbc::status, svrSockOpenForInConn(), SYS_THREAD_RESOURCE_ERR, ThisComm, and rsComm_t::thread_ctx.
Referenced by runIrodsAgentFactory(), and xmsgServerMain().
int initHostConfigByFile | ( | ) |
Definition at line 629 of file initServer.cpp.
References irods::error::code(), terminate_irods_processes::e, ERROR, irods::configuration_parser::get(), irods::get_full_path_for_config_file(), HOST_CONFIG_FILE, HostConfigHead, INVALID_ANY_CAST, KEY_NOT_FOUND, irods::configuration_parser::load(), LOCAL_HOST, irods::log(), LOG_ERROR, LOG_NOTICE, irods::error::ok(), PASS, queHostName(), queRodsServerHost(), REMOTE_HOST, rodsLog(), and ZoneInfoHead.
Referenced by initServerInfo().
int initLocalServerHost | ( | ) |
Definition at line 144 of file initServer.cpp.
References LOCAL_HOST, rodsServerHost::localFlag, LocalServerHost, LOG_NOTICE, matchHostConfig(), MAX_NAME_LEN, myHostName, printServerHost(), ProcessType, queAddr(), queHostName(), rodsLog(), SERVER_PT, ServerHostHead, irods.pypyodbc::status, SYS_GET_HOSTNAME_ERR, rodsServerHost::zoneInfo, and ZoneInfoHead.
Referenced by initServerInfo().
int initRcatServerHostByFile | ( | ) |
Definition at line 187 of file initServer.cpp.
References irods::CFG_CATALOG_PROVIDER_HOSTS_KW(), irods::CFG_FEDERATION_KW(), irods::CFG_IRODS_XMSG_HOST_KW(), irods::CFG_KERBEROS_NAME_KW(), irods::CFG_NEGOTIATION_KEY_KW(), irods::CFG_ZONE_KEY_KW(), irods::CFG_ZONE_NAME_KW(), terminate_irods_processes::e, irods::get_server_property(), rodsHostAddr_t::hostAddr, KerberosName, LOCAL_ICAT, LOCAL_ZONE_SID_KW, localSID, irods::log(), LOG_ERROR, LOG_SYS_FATAL, rodsServerHost::rcatEnabled, remote_SID_key_map, REMOTE_ZONE_SID_KW, resolveHost(), rodsLog(), and rodsServerHost::xmsgHostFlag.
Referenced by initServerInfo().
Definition at line 727 of file initServer.cpp.
References authInfo_t::authFlag, userInfo_t::authInfo, authInfo_t::authScheme, irods::CFG_ZONE_AUTH_SCHEME(), irods::CFG_ZONE_NAME(), irods::CFG_ZONE_USER(), rsComm_t::clientUser, terminate_irods_processes::e, ERROR, getRodsEnv(), LOCAL_PRIV_USER_AUTH, irods::log(), rsComm_t::myEnv, NAME_LEN, rsComm_t::proxyUser, userInfo_t::rodsZone, rstrcpy(), irods.pypyodbc::status, userInfo_t::userName, and manual_cleanup::zone_name.
Referenced by xmsgServerMain().
int initRsCommWithStartupPack | ( | rsComm_t * | rsComm, |
startupPack_t * | startupPack | ||
) |
Definition at line 834 of file initServer.cpp.
References startupPack::apiVersion, version_t::apiVersion, authInfo_t::authFlag, userInfo_t::authInfo, rsComm_t::clientAddr, startupPack::clientRodsZone, rsComm_t::clientUser, startupPack::clientUser, rsComm_t::cliVersion, rsComm_t::connectCnt, startupPack::connectCnt, IRODS_PROT, rsComm_t::irodsProt, startupPack::irodsProt, rsComm_t::localAddr, LOG_NOTICE, LONG_NAME_LEN, NAME_LEN, NATIVE_PROT, NULL, rsComm_t::option, startupPack::option, startupPack::proxyRodsZone, rsComm_t::proxyUser, startupPack::proxyUser, PUBLIC_USER_AUTH, PUBLIC_USER_NAME, rsComm_t::reconnFlag, startupPack::reconnFlag, startupPack::relVersion, version_t::relVersion, rsComm_t::remoteAddr, rodsLog(), userInfo_t::rodsZone, rstrcpy(), setLocalAddr(), setRemoteAddr(), rsComm_t::sock, SP_API_VERSION, SP_CLIENT_RODS_ZONE, SP_CLIENT_USER, SP_CONNECT_CNT, SP_NEW_SOCK, SP_OPTION, SP_PROTOCOL, SP_PROXY_RODS_ZONE, SP_PROXY_USER, SP_RECONN_FLAG, SP_REL_VERSION, SYS_GETSTARTUP_PACK_ERR, userInfo_t::userName, and XML_PROT.
Referenced by procReqRoutine(), and runIrodsAgentFactory().
Definition at line 57 of file initServer.cpp.
References irods::CFG_SERVICE_ROLE_PROVIDER(), irods::CFG_ZONE_NAME(), irods::CFG_ZONE_PORT(), irods::error::code(), connectRcat(), terminate_irods_processes::e, get_catalog_service_role(), irods::resource_manager::init_from_catalog(), initHostConfigByFile(), initLocalServerHost(), initRcatServerHostByFile(), initZone(), irods::log(), LOG_DEBUG, LOG_NOTICE, LOG_SYS_FATAL, NULL, irods::error::ok(), PASS, PASSMSG, queZone(), resc_mgr, rodsLog(), irods.pypyodbc::status, and manual_cleanup::zone_name.
Referenced by initAgent(), and initServer().
Definition at line 312 of file initServer.cpp.
References addInxIval(), CAT_NO_ROWS_FOUND, irods::CFG_ZONE_NAME(), clearGenQueryInp(), rsComm_t::clientUser, COL_ZONE_COMMENT, COL_ZONE_CONNECTION, COL_ZONE_NAME, COL_ZONE_TYPE, terminate_irods_processes::e, freeGenQueryOut(), getSqlResultByInx(), rodsHostAddr_t::hostAddr, SqlResult::len, LOCAL_ICAT, LOCAL_SLAVE_ICAT, rodsServerHost::localFlag, irods::log(), LOG_ERROR, LOG_NOTICE, zoneInfo::masterServerHost, MAX_SQL_ROWS, GenQueryInp::maxRows, NAME_LEN, rodsServerHost::next, NULL, parseHostAddrStr(), rodsHostAddr_t::portNum, zoneInfo::portNum, rsComm_t::proxyUser, queZone(), rodsServerHost::rcatEnabled, REMOTE_HOST, REMOTE_ICAT, resolveHost(), rodsLog(), userInfo_t::rodsZone, GenQueryOut::rowCnt, rsGenQuery(), rstrcpy(), GenQueryInp::selectInp, ServerHostHead, zoneInfo::slaveServerHost, irods.pypyodbc::status, UNMATCHED_KEY_OR_INDEX, SqlResult::value, manual_cleanup::zone_name, rodsServerHost::zoneInfo, ZoneInfoHead, rodsHostAddr_t::zoneName, and zoneInfo::zoneName.
Referenced by initServerInfo().
Definition at line 796 of file initServer.cpp.
References getLogfileName(), NULL, SINGLE_PASS, and SYS_INTERNAL_NULL_INPUT_ERR.
Referenced by main().
Definition at line 1109 of file initServer.cpp.
References irods::error::code(), FILE_OPEN_ERR, irods::get_full_path_for_unmoved_configs(), LOCK_FILE_DIR, LOCK_FILE_PURGE_TIME, irods::log(), LOG_ERROR, MAX_NAME_LEN, NULL, irods::error::ok(), PASS, irods::experimental::filesystem::client::remove(), rodsLog(), rodsLogError(), irods.pypyodbc::status, UNIX_FILE_OPENDIR_ERR, and UNIX_FILE_STAT_ERR.
Referenced by initServer(), and purgeLockFileWorkerTask().
int queAgentProc | ( | agentProc_t * | agentProc, |
agentProc_t ** | agentProcHead, | ||
irodsPosition_t | position | ||
) |
Definition at line 1079 of file initServer.cpp.
References agentProc::next, NULL, TOP_POS, and USER__NULL_INPUT_ERR.
Referenced by addConnReqToQue(), queueConnectedAgentProc(), and readWorkerTask().
void rsPipeSignalHandler | ( | int | ) |
Definition at line 599 of file initServer.cpp.
References BROKEN_PIPE_INT, BrokenPipeCnt, cleanupAndExit(), LastBrokenPipeTime, LOG_NOTICE, MAX_BROKEN_PIPE_CNT, NULL, rsComm_t::reconnSock, rodsLog(), SYS_CAUGHT_SIGNAL, and ThisComm.
Referenced by main().
Definition at line 1060 of file initServer.cpp.
References irods::CFG_ZONE_NAME(), irods::CFG_ZONE_USER(), rsComm_t::clientUser, terminate_irods_processes::e, irods::log(), NAME_LEN, rsComm_t::proxyUser, userInfo_t::rodsZone, rstrcpy(), userInfo_t::userName, and manual_cleanup::zone_name.
Referenced by initServerMain().
void signalExit | ( | int | ) |
Definition at line 589 of file initServer.cpp.
References cleanupAndExit(), LOG_NOTICE, rodsLog(), and SYS_CAUGHT_SIGNAL.
Referenced by main().
|
static |
Definition at line 47 of file initServer.cpp.
Referenced by rsPipeSignalHandler().
|
static |
Definition at line 46 of file initServer.cpp.
Referenced by rsPipeSignalHandler().