Esempio n. 1
0
function vmtools(){
	$binpath=_vmtools_bin_path();
	if($binpath==null){return null;}
	
	$enabled=1;
	$pid_path="/var/run/vmware-guestd.pid";
	$master_pid=trim(@file_get_contents($pid_path));
	if($master_pid==null){
		$master_pid=$GLOBALS["CLASS_UNIX"]->PIDOF($binpath);
	}

	$l[]="[APP_VMTOOLS]";
	$l[]="service_name=APP_VMTOOLS";
	$l[]="master_version=".GetVersionOf("vmtools");
	$l[]="service_cmd=vmtools";	
	$l[]="service_disabled=$enabled";
	
	$l[]="family=system";
	$l[]="pid_path=$pid_path";
	$l[]="binpath=$binpath";
	//$l[]="remove_cmd=--zarafa-remove";

	if(!$GLOBALS["CLASS_UNIX"]->process_exists($master_pid)){
		WATCHDOG("APP_VMTOOLS","vmtools");
		$l[]="running=0\ninstalled=1";$l[]="";
		return implode("\n",$l);
		return;
	}		
	
	$l[]="running=1";
	$l[]=GetMemoriesOf($master_pid);
	$l[]="";
	return implode("\n",$l);return;		
}
Esempio n. 2
0
function vmtools()
{
    $binpath = _vmtools_bin_path();
    if ($binpath == null) {
        if ($GLOBALS["VERBOSE"]) {
            echo "Not Installed\n";
        }
        return null;
    }
    $enabled = 1;
    $pid_path = vmtools_pid();
    $master_pid = trim(@file_get_contents($pid_path));
    if ($master_pid == null) {
        $master_pid = $GLOBALS["CLASS_UNIX"]->PIDOF($binpath);
    }
    $vmtools_init = vmtools_init();
    $l[] = "[APP_VMTOOLS]";
    $l[] = "service_name=APP_VMTOOLS";
    $l[] = "master_version=" . vmtools_version_text();
    $l[] = "service_cmd={$vmtools_init}";
    $l[] = "service_disabled={$enabled}";
    $l[] = "family=system";
    $l[] = "pid_path={$pid_path}";
    $l[] = "binpath={$binpath}";
    //$l[]="remove_cmd=--zarafa-remove";
    if (!$GLOBALS["CLASS_UNIX"]->process_exists($master_pid)) {
        shell_exec2("{$GLOBALS["nohup"]} {$vmtools_init} start >/dev/null 2>&1 &");
        $l[] = "running=0\ninstalled=1";
        $l[] = "";
        return implode("\n", $l);
    }
    $l[] = "running=1";
    $l[] = GetMemoriesOf($master_pid);
    $l[] = "";
    return implode("\n", $l);
    return;
}