Electroneum
daemonizer Namespace Reference

Functions

void init_options (boost::program_options::options_description &hidden_options, boost::program_options::options_description &normal_options)
 
boost::filesystem::path get_default_data_dir ()
 Returns the default data directory. More...
 
boost::filesystem::path get_relative_path_base (boost::program_options::variables_map const &vm)
 
template<typename T_executor >
bool daemonize (int argc, char const *argv[], T_executor &&executor, boost::program_options::variables_map const &vm)
 

Function Documentation

◆ daemonize()

template<typename T_executor >
bool daemonizer::daemonize ( int  argc,
char const *  argv[],
T_executor &&  executor,
boost::program_options::variables_map const &  vm 
)
  • create_before_detach - this indicates that the daemon should be created before the fork, giving it a chance to report initialization errors. At the time of this writing, this is not possible in the primary daemon (likely due to the size of the blockchain in memory).
Here is the caller graph for this function:

◆ get_default_data_dir()

boost::filesystem::path daemonizer::get_default_data_dir ( )

Returns the default data directory.

Windows < Vista: C:\Documents and Settings\Username\Application Data\CRYPTONOTE_NAME

Windows >= Vista: C:\Users\Username\AppData\Roaming\CRYPTONOTE_NAME

Mac: ~/Library/Application Support/CRYPTONOTE_NAME

Unix: ~/.CRYPTONOTE_NAME

Definition at line 600 of file util.cpp.

601  {
602  /* Please for the love of god refactor the ifdefs out of this */
603 
604  // namespace fs = boost::filesystem;
605  // Windows < Vista: C:\Documents and Settings\Username\Application Data\CRYPTONOTE_NAME
606  // Windows >= Vista: C:\Users\Username\AppData\Roaming\CRYPTONOTE_NAME
607  // Unix & Mac: ~/.CRYPTONOTE_NAME
608  std::string config_folder;
609 
610 #ifdef WIN32
611  config_folder = get_special_folder_path(CSIDL_COMMON_APPDATA, true) + "\\" + CRYPTONOTE_NAME;
612 #else
613  std::string pathRet;
614  char* pszHome = getenv("HOME");
615  if (pszHome == NULL || strlen(pszHome) == 0)
616  pathRet = "/";
617  else
618  pathRet = pszHome;
619  config_folder = (pathRet + "/." + CRYPTONOTE_NAME);
620 #endif
621 
622  return config_folder;
623  }
::std::string string
Definition: gtest-port.h:1097
#define CRYPTONOTE_NAME
Here is the caller graph for this function:

◆ get_relative_path_base()

boost::filesystem::path daemonizer::get_relative_path_base ( boost::program_options::variables_map const &  vm)

◆ init_options()

void daemonizer::init_options ( boost::program_options::options_description &  hidden_options,
boost::program_options::options_description &  normal_options 
)
Here is the caller graph for this function: