function isRunning()
{
+ if(!runningCheck) {
+ // this code does the check to see if it should be running .. i.e. am i the system server. we only want to do this check once
+ runningCheck = true;
+ shouldIRun = false;
+ }
+
// the purpose of this function is two fold, first determines if it should be running and return true if not
// then checks if the ss is running or not and returns true if it is
+ return true;
}
+
+ private runningCheck = false;
+ private shouldIRun = false;
}
?>
\ No newline at end of file
function go()
{
// my job is to keep daemons running.
+ $lhms = new hostManagementServer();
+ $lss = new systemServer();
while(true) {
- $lhms = new hostManagementServer();
- $lss = new systemServer();
if(!$lhms->isRunning()) {
startHMS();
if(!$lss->isRunning()) {
startSS();
}
+
+ sleep(5);
}
}