예제 #1
0
function dpkg_configure_a()
{
    if (system_is_overloaded(basename(__FILE__))) {
        system_admin_events("Overloaded system... aborting task...", __FUNCTION__, __FILE__, __LINE__, "system-update");
        die;
    }
    $unix = new unix();
    $binpath = $unix->find_program("dpkg-reconfigure");
    if (strlen($binpath) == null) {
        return;
    }
    exec("{$binpath} -a -f -p 2>&1", $results);
    while (list($num, $val) = each($results)) {
        $val = strip_error_perl($val);
        if ($val == null) {
            continue;
        }
        if (preg_match("#-reconfigure:\\s+(.+?)\\s+is broken or not fully installed#", $val, $re)) {
            $f[] = "ERROR DETECTED! on {$re[1]} package, see artica support \"{$val}\"";
            continue;
        }
        $f[] = $val;
    }
    if (count($f) > 0) {
        system_admin_events("Failed: DPKG reconfigure results\nIt seems that the system need to reconfigure package, this is the results:" . @implode("\n", $f), __FUNCTION__, __FILE__, __LINE__, "system-update");
    }
}
예제 #2
0
function dpkg_configure_a(){
	
	$unix=new unix();
	$binpath=$unix->find_program("dpkg-reconfigure");
	if(strlen($binpath)==null){return;}
	exec("$binpath -a -f -p 2>&1",$results);
	while (list ($num, $val) = each ($results) ){
		$val=strip_error_perl($val);
		if($val==null){continue;}
		if(preg_match("#-reconfigure:\s+(.+?)\s+is broken or not fully installed#",$val,$re)){
			$f[]="ERROR DETECTED! on {$re[1]} package, see artica support \"$val\"";
			continue;
		}
		$f[]=$val;
	}
	
	if(count($f)>0){
		send_email_events("System: DPKG reconfigure results","It seems that the system need to reconfigure package, this is the results:".@implode("\n",$f),"system");
	}
	
}