cooling/cooling.cc
/// Start the child rsked. Will kill any rsked already running, as
/// identified by its pid file.
///
/// \returns true if rsked started normally or was already running,
/// but returns false if:
/// - there is another rsked running that we cannot kill
/// - rsked fails to start
/// - rsked starts but dies quickly
///
Start the child rsked. Will kill any rsked already running, as
identified by its pid file.

\returns true if rsked started normally or was already running,
but returns false if:
there is another rsked running that we cannot kill
rsked fails to start
rsked starts but dies quickly
Start the child rsked . Will kill any rsked already running as identified by its pid file . \ returns true if rsked started normally or was already running but returns false if : there is another rsked running that we cannot kill rsked fails to start rsked starts but dies quickly
bool Cooling::start_rsked_once()
{
    if (m_rsked_cm->running()) {
        LOG_WARNING(Lgr) << "rsked already running";
        return true;
    }
    terminate_rsked();
     Start child rsked with given shared memory key and config file.
     Turn on debug if m_rsked_debug has been set to true.
    m_sh_token = ftok( m_rsked_bin_path.c_str(), 1 );
    LOG_DEBUG(Lgr) << "Shared memory token: " << m_sh_token;
    m_rsked_cm->set_binary( m_rsked_bin_path );
    m_rsked_cm->clear_args();
    if (m_rsked_debug) {
        m_rsked_cm->add_arg("--debug");
    }
    m_rsked_cm->add_arg("--shmkey");
    m_rsked_cm->add_arg( std::to_string(m_sh_token) );
    m_rsked_cm->add_arg("--config");
    m_rsked_cm->add_arg(m_rsked_cfg_path.native());
    try {
        m_rsked_cm->start_child();
        sleep( Wait_for_rsked_start_secs );
    } catch(...) {
        LOG_ERROR(Lgr) << "Exception: could not start application rsked";
        return false;
    }
    RunCond status { RunCond::okay };
    if (not m_rsked_cm->check_child(status)) {
        LOG_ERROR(Lgr) << "child rsked did not start normally: "
                       << Child_mgr::cond_name(status);
        return false;
    }
    LOG_INFO(Lgr) << "started child process rsked";
    setup_shmem();
    return true;
}
bool Cooling :: start_rsked_once ( ) { if ( m_rsked_cm -> running ( ) ) { LOG_WARNING ( Lgr ) << " " ; return true ; } terminate_rsked ( ) ; m_sh_token = ftok ( m_rsked_bin_path . c_str ( ) , 1 ) ; LOG_DEBUG ( Lgr ) << " " << m_sh_token ; m_rsked_cm -> set_binary ( m_rsked_bin_path ) ; m_rsked_cm -> clear_args ( ) ; if ( m_rsked_debug ) { m_rsked_cm -> add_arg ( " " ) ; } m_rsked_cm -> add_arg ( " " ) ; m_rsked_cm -> add_arg ( std :: to_string ( m_sh_token ) ) ; m_rsked_cm -> add_arg ( " " ) ; m_rsked_cm -> add_arg ( m_rsked_cfg_path . native ( ) ) ; try { m_rsked_cm -> start_child ( ) ; sleep ( Wait_for_rsked_start_secs ) ; } catch ( ... ) { LOG_ERROR ( Lgr ) << " " ; return false ; } RunCond status { RunCond :: okay } ; if ( not m_rsked_cm -> check_child ( status ) ) { LOG_ERROR ( Lgr ) << " " << Child_mgr :: cond_name ( status ) ; return false ; } LOG_INFO ( Lgr ) << " " ; setup_shmem ( ) ; return true ; }
Start the child rsked.
Start the child rsked .
// // Start child rsked with given shared memory key and config file. // Turn on debug if m_rsked_debug has been set to true.