cooling/cooling.cc
/// Respond to SIGUSR1 by reloading the configuration file, e.g. cooling.json.
/// The primary use of this is to adjust the temperature thresholds, polling,
/// and debug flag. However the following significant effects might occur:
/// - if rsked had been enabled and is now disabled, the running rsked is killed
/// - if rsked had been disabled and is now enabled, an rsked will be started
/// - if any rsked parameters changed, rsked is restarted
///
Respond to SIGUSR1 by reloading the configuration file, e.g.
Respond to SIGUSR1 by reloading the configuration file e . g .
void Cooling::reload_config()
{
    bool     old_ren  { m_rsked_enabled };
    bool     old_rdb  { m_rsked_debug };
    fs::path old_rbp  { m_rsked_bin_path };
    fs::path old_rcp  { m_rsked_cfg_path };
    try {
        initialize(m_debug);
        if (m_rsked_enabled and old_ren) {
            if ((m_rsked_debug != old_rdb) or (m_rsked_bin_path != old_rbp)
                or (m_rsked_cfg_path != old_rcp))
            {
                LOG_WARNING(Lgr) << "Rsked must be restarted with new parameters";
                terminate_rsked();
            }
        }
        start_rsked();          
    }
    catch (const std::exception &xxx) {
        std::cerr << "Cooling: Failed to reload configuration: " << xxx.what() << '\n';
        LOG_ERROR(Lgr) << "Failed to reload configuration: " << xxx.what();
    }
}
void Cooling :: reload_config ( ) { bool old_ren { m_rsked_enabled } ; bool old_rdb { m_rsked_debug } ; fs :: path old_rbp { m_rsked_bin_path } ; fs :: path old_rcp { m_rsked_cfg_path } ; try { initialize ( m_debug ) ; if ( m_rsked_enabled and old_ren ) { if ( ( m_rsked_debug != old_rdb ) or ( m_rsked_bin_path != old_rbp ) or ( m_rsked_cfg_path != old_rcp ) ) { LOG_WARNING ( Lgr ) << " " ; terminate_rsked ( ) ; } } start_rsked ( ) ; } catch ( const std :: exception & xxx ) { std :: cerr << " " << xxx . what ( ) << ' \n ' ; LOG_ERROR ( Lgr ) << " " << xxx . what ( ) ; } }
Respond to SIGUSR1 by reloading the configuration file, e.g.
Respond to SIGUSR1 by reloading the configuration file e . g .
// possibly stop running rsked // will stop rsked if it should not be running