Esempio n. 1
0
int
reSvrSleep (rsComm_t *rsComm)
{
    int status;
    rodsServerHost_t *rodsServerHost = NULL;

    if ((status = disconnRcatHost (rsComm, MASTER_RCAT, 
      rsComm->myEnv.rodsZone)) == LOCAL_HOST) {
#ifdef RODS_CAT
#ifndef ORA_ICAT
       /* For Oracle, we don't disconnect.  This is to avoid a 
          memory leak in the OCI library */
        disconnectRcat (rsComm);
        if (status < 0) {
            rodsLog (LOG_ERROR,
              "reSvrSleep: disconnectRcat error. status = %d", status);
        }
#endif
#endif
    }
    rodsSleep (RE_SERVER_SLEEP_TIME, 0);

    if ((status = getAndConnRcatHost (rsComm, MASTER_RCAT, 
      rsComm->myEnv.rodsZone, &rodsServerHost)) == LOCAL_HOST) {
#ifdef RODS_CAT
        status = connectRcat (rsComm);
        if (status < 0) {
            rodsLog (LOG_ERROR,
              "reSvrSleep: connectRcat error. status = %d", status);
	}
#endif
    }
    return (status);
}
Esempio n. 2
0
int
initServerInfo( rsComm_t *rsComm ) {
    int status = 0;

    irods::server_properties& props = irods::server_properties::getInstance();
    irods::error ret = props.capture_if_needed();
    if ( !ret.ok() ) {
        irods::log( PASS( ret ) );
        return ret.code();
    }

    std::string zone_name;
    ret = props.get_property <
          std::string > (
              irods::CFG_ZONE_NAME,
              zone_name );
    if ( !ret.ok() ) {
        irods::log( PASS( ret ) );
        return ret.code();

    }

    int zone_port = 0;
    ret = props.get_property <
          int > (
              irods::CFG_ZONE_PORT,
              zone_port );
    if ( !ret.ok() ) {
        irods::log( PASS( ret ) );
        return ret.code();

    }

    /* que the local zone */
    status = queZone(
                 zone_name.c_str(),
                 zone_port, NULL, NULL );
    if ( status < 0 ) {
        rodsLog(
            LOG_DEBUG,
            "initServerInfo - queZone failed %d",
            status );
        // do not error out
    }

    status = initHostConfigByFile();
    if ( status < 0 ) {
        rodsLog( LOG_NOTICE,
                 "initServerInfo: initHostConfigByFile error, status = %d",
                 status );
        return status;
    }

    status = initLocalServerHost();
    if ( status < 0 ) {
        rodsLog( LOG_NOTICE,
                 "initServerInfo: initLocalServerHost error, status = %d",
                 status );
        return status;
    }

    status = initRcatServerHostByFile();
    if ( status < 0 ) {
        rodsLog( LOG_SYS_FATAL,
                 "initServerInfo: initRcatServerHostByFile error, status = %d",
                 status );
        return status;
    }

#ifdef RODS_CAT
    status = connectRcat();
    if ( status < 0 ) {
        rodsLog(
            LOG_SYS_FATAL,
            "initServerInfo: connectRcat failed, status = %d",
            status );

        return status;
    }
#endif

    status = initZone( rsComm );
    if ( status < 0 ) {
        rodsLog( LOG_SYS_FATAL,
                 "initServerInfo: initZone error, status = %d",
                 status );
        return status;
    }

    ret = resc_mgr.init_from_catalog( rsComm );
    if ( !ret.ok() ) {
        irods::error log_err = PASSMSG( "init_from_catalog failed", ret );
        irods::log( log_err );
    }

    return status;
}