cooling/cooling.cc
/// Best effort to kill off processes matching pattern,
/// m_kill_pattern, if set.  Only processes whose names exactly match
/// the pattern will be affected.  Warning: this will block until any kill
/// actions complete.
///
Best effort to kill off processes matching pattern,
m_kill_pattern, if set.  Only processes whose names exactly match
the pattern will be affected.  Warning: this will block until any kill
actions complete.
Best effort to kill off processes matching pattern m_kill_pattern if set . Only processes whose names exactly match the pattern will be affected . Warning : this will block until any kill actions complete .
void Cooling::kill_aux_processes()
{
    stop_mpd_player();
    if (! m_kill_pattern.empty() ) {
        std::string pcmd("/usr/bin/pkill -x -TERM ");
        pcmd += m_kill_pattern;
        LOG_INFO(Lgr) << "kill_aux_processes matching: " << m_kill_pattern;
        int rc1 = system( pcmd.c_str() );
        if (WIFEXITED(rc1)) {
            int rc = WEXITSTATUS(rc1);
            if (rc > 1) {   status=1 means no matching processes
                LOG_ERROR(Lgr) << "kill_aux_processes--pkill exits with status " << rc;
            }
        } else {  abnormal:  stopped, killed by signal, continued
            LOG_ERROR(Lgr) << "kill_aux_processes: pkill had unexpected problems.";
        }
    }
}
void Cooling :: kill_aux_processes ( ) { stop_mpd_player ( ) ; if ( ! m_kill_pattern . empty ( ) ) { std :: string pcmd ( " " ) ; pcmd += m_kill_pattern ; LOG_INFO ( Lgr ) << " " << m_kill_pattern ; int rc1 = system ( pcmd . c_str ( ) ) ; if ( WIFEXITED ( rc1 ) ) { int rc = WEXITSTATUS ( rc1 ) ; if ( rc > 1 ) { LOG_ERROR ( Lgr ) << " " << rc ; } } else { LOG_ERROR ( Lgr ) << " " ; } } }
Best effort to kill off processes matching pattern,
m_kill_pattern, if set.
Best effort to kill off processes matching pattern m_kill_pattern if set .
// // status=1 means no matching processes // abnormal:  stopped, killed by signal, continued