Back to index

nordugrid-arc-nox  1.1.0~rc6
Functions
environment.h File Reference
#include <string>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::string globus_loc (void)
 Globus installation path - $GLOBUS_LOCATION, /opt/globus.
std::string globus_scripts_loc (void)
std::string nordugrid_loc (void)
 ARC installation path - $ARC_LOCATION, executable path.
std::string nordugrid_libexec_loc (void)
 ARC system tools - $ARC_LOCATION/libexec/arc, $ARC_LOCATION/libexec.
std::string nordugrid_lib_loc (void)
std::string nordugrid_sbin_loc (void)
std::string nordugrid_config_loc (void)
 ARC configuration file /etc/arc.conf $ARC_LOCATION/etc/arc.conf.
void nordugrid_config_loc (const std::string &)
std::string cert_dir_loc ()
std::string runtime_config_dir (void)
void runtime_config_dir (const std::string &)
std::string support_mail_address (void)
 Email address of person responsible for this ARC installation grid.manager, it can also be set from configuration file.
void support_mail_address (const std::string &)
std::string globus_gridmap (void)
 Global gridmap files with welcomed users' DNs and UNIX names $GRIDMAP, default /etc/grid-security/grid-mapfile.
bool read_env_vars (bool guess=false)
 Read environment, check files and set variables Accepts: guess - if false, default values are not allowed. Returns: true - success. false - something is missing.

Function Documentation

std::string cert_dir_loc ( )

Definition at line 164 of file environment.cpp.

                             {
  return cert_dir_loc_.str();
}

Here is the call graph for this function:

Here is the caller graph for this function:

std::string globus_gridmap ( void  )

Global gridmap files with welcomed users' DNs and UNIX names $GRIDMAP, default /etc/grid-security/grid-mapfile.

Definition at line 188 of file environment.cpp.

                               {
  return globus_gridmap_.str();
}

Here is the call graph for this function:

Here is the caller graph for this function:

std::string globus_loc ( void  )

Globus installation path - $GLOBUS_LOCATION, /opt/globus.

Definition at line 136 of file environment.cpp.

                           {
  return globus_loc_.str();
}

Here is the call graph for this function:

Here is the caller graph for this function:

std::string globus_scripts_loc ( void  )

Definition at line 140 of file environment.cpp.

                                   {
  return globus_scripts_loc_.str();
}

Here is the call graph for this function:

std::string nordugrid_config_loc ( void  )

ARC configuration file /etc/arc.conf $ARC_LOCATION/etc/arc.conf.

Definition at line 160 of file environment.cpp.

                                     {
  return nordugrid_config_loc_.str();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nordugrid_config_loc ( const std::string &  )

Definition at line 168 of file environment.cpp.

std::string nordugrid_lib_loc ( void  )

Definition at line 152 of file environment.cpp.

                                  {
  return nordugrid_lib_loc_.str();
}

Here is the call graph for this function:

std::string nordugrid_libexec_loc ( void  )

ARC system tools - $ARC_LOCATION/libexec/arc, $ARC_LOCATION/libexec.

Definition at line 148 of file environment.cpp.

                                      {
  return nordugrid_libexec_loc_.str();
}

Here is the call graph for this function:

Here is the caller graph for this function:

std::string nordugrid_loc ( void  )

ARC installation path - $ARC_LOCATION, executable path.

Definition at line 144 of file environment.cpp.

                              {
  return nordugrid_loc_.str();
}

Here is the call graph for this function:

Here is the caller graph for this function:

std::string nordugrid_sbin_loc ( void  )

Definition at line 156 of file environment.cpp.

                                   {
  return nordugrid_sbin_loc_.str();
}

Here is the call graph for this function:

bool read_env_vars ( bool  guess = false)

Read environment, check files and set variables Accepts: guess - if false, default values are not allowed. Returns: true - success. false - something is missing.

Definition at line 207 of file environment.cpp.

                               {
  if(globus_loc_.empty()) {
    globus_loc_=Arc::GetEnv("GLOBUS_LOCATION");
    if(globus_loc_.empty()) {
      if(!guess) {
        olog<<"Warning: GLOBUS_LOCATION environment variable not defined"<<std::endl;
        //return false;
      }
      else {
        globus_loc_="/opt/globus";
      };
    };
    Arc::SetEnv("GLOBUS_LOCATION",globus_loc_.str());
  };
  globus_scripts_loc_=globus_loc_+"/libexec";

  if(nordugrid_loc_.empty()) {
    nordugrid_loc_=Arc::GetEnv("ARC_LOCATION");
    if(nordugrid_loc_.empty()) {
      nordugrid_loc_=Arc::ArcLocation::Get();
    };
    nordugrid_lib_loc_=nordugrid_loc_+"/"+PKGLIBSUBDIR;
    nordugrid_libexec_loc_=nordugrid_loc_+"/"+PKGLIBEXECSUBDIR;
  };

  if(nordugrid_config_loc_.empty()) {
    std::string tmp = Arc::GetEnv("ARC_CONFIG");
    if(tmp.empty()) {
      tmp=Arc::GetEnv("NORDUGRID_CONFIG");
      if(tmp.empty()) {
        tmp="/etc/arc.conf";
        nordugrid_config_loc_=tmp;
        if(!file_exists(tmp.c_str())) {
          olog<<"Central configuration file is missing at guessed location:\n"
              <<"  /etc/arc.conf\n"
              <<"Use ARC_CONFIG variable for non-standard location"
              <<std::endl;
          return false;
        };
      };
    };
    if(!tmp.empty()) nordugrid_config_loc_=tmp;
  };
  
  if(cert_dir_loc_.empty()) {
    cert_dir_loc_=Arc::GetEnv("X509_CERT_DIR");
  };

  // Set all environement variables for other tools
  Arc::SetEnv("ARC_CONFIG",nordugrid_config_loc_);
  if(support_mail_address_.empty()) {
    char hn[100];
    support_mail_address_="grid.manager@";
    if(gethostname(hn,99) == 0) {
      support_mail_address_+=hn;
    }
    else {
      support_mail_address_+="localhost";
    };
  };
  std::string tmp=Arc::GetEnv("GRIDMAP");
  if(tmp.empty()) { globus_gridmap_="/etc/grid-security/grid-mapfile"; }
  else { globus_gridmap_=tmp; };
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

std::string runtime_config_dir ( void  )

Definition at line 172 of file environment.cpp.

                                   {
  return runtime_config_dir_.str();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void runtime_config_dir ( const std::string &  )

Definition at line 176 of file environment.cpp.

std::string support_mail_address ( void  )

Email address of person responsible for this ARC installation grid.manager, it can also be set from configuration file.

Definition at line 180 of file environment.cpp.

                                     {
  return support_mail_address_.str();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void support_mail_address ( const std::string &  )

Definition at line 184 of file environment.cpp.