pub fn spawn_prescript(prescript: &Script, vars: Option<&GlobalVars>) -> u32 {
    let result = prescript.spawn(vars);

    // check rc
    if let Err(e) = &result {
        error!("error: {} spawning prescript: {:?}", e, prescript.command);
        Nagios::exit_critical(&format!(
            "error: {} spawning prescript: {:?}",
            e, prescript.command
        ));
    }

    // now it's safe to unwrap to get pid
    debug_assert!(result.is_ok());
    result.unwrap()
}
/// Spawn a prescript and returns its pid
Spawn a prescript and returns its pid
Spawn a prescript and returns its pid
pub fn spawn_prescript(prescript: &Script, vars: Option<&GlobalVars>) -> u32 {
    let result = prescript.spawn(vars);
    // check rc
    if let Err(e) = &result {
        error!("error: {} spawning prescript: {:?}", e, prescript.command);
        Nagios::exit_critical(&format!(
            "error: {} spawning prescript: {:?}",
            e, prescript.command
        ));
    }
    // now it's safe to unwrap to get pid
    debug_assert!(result.is_ok());
    result.unwrap()
}
pub fn spawn_prescript ( prescript : & Script , vars : Option < & GlobalVars > ) -> u32 { let result = prescript . spawn ( vars ) ; // check rc if let Err ( e ) = & result { error ! ( " " e prescript command ) ; Nagios :: exit_critical ( & format ! ( " " e prescript command ) ) ; } // now it's safe to unwrap to get pid debug_assert ! ( result is_ok ( ) ) ; result . unwrap ( ) }
Spawn a prescript and returns its pid
Spawn a prescript and returns its pid
prescript
&Script
vars
Option<&GlobalVars>
prescript
&Script
vars
Option<&GlobalVars>