diff --git a/setup/wizard/lib/services/unixScheduler.php b/setup/wizard/lib/services/unixScheduler.php index 7cf401a..d936497 100755 --- a/setup/wizard/lib/services/unixScheduler.php +++ b/setup/wizard/lib/services/unixScheduler.php @@ -108,19 +108,19 @@ class unixScheduler extends Service { } function install() { -// $source = $this->getSchedulerSourceLoc(); -// if($source) { -// $cmd = "nohup ".$source." &> ".SYS_LOG_DIR."dmsctl.log"; -// $response = $this->util->pexec($cmd); -// return $response; -// } else { -// $source = $this->getSystemDir().$this->schedulerSource; -// if(file_exists($source)) { -// $cmd = "nohup ".$source." &> ".SYS_LOG_DIR."dmsctl.log"; -// $response = $this->util->pexec($cmd); -// return $response; -// } -// } + $source = $this->getSchedulerSourceLoc(); + if($source) { + $cmd = "nohup ".$source." &> ".SYS_LOG_DIR."dmsctl.log"; + $response = $this->util->pexec($cmd); + return $response; + } else { // Could be Stack + $source = $this->getSystemDir().$this->schedulerSource; + if(file_exists($source)) { + $cmd = "nohup ".$source." &> ".SYS_LOG_DIR."dmsctl.log"; + $response = $this->util->pexec($cmd); + return $response; + } + } return false; } diff --git a/setup/wizard/lib/services/windowsLucene.php b/setup/wizard/lib/services/windowsLucene.php index e9a771e..3b41a83 100755 --- a/setup/wizard/lib/services/windowsLucene.php +++ b/setup/wizard/lib/services/windowsLucene.php @@ -364,10 +364,15 @@ class windowsLucene extends windowsService { * @return array */ function install() { - $cmd = "\"{$this->getLuceneExe()}\""." -install \"".$this->getName()."\" \"".$this->getJavaJVM(). "\" -Djava.class.path=\"". $this->getLuceneSource()."\"". " -start ".$this->getLuceneServer(). " -out \"".$this->getLuceneOut()."\" -err \"".$this->getLuceneError()."\" -current \"".$this->getluceneDir()."\" -auto"; - $response = $this->util->pexec($cmd); + $state = $this->status(); + if($state == '') { + $cmd = "\"{$this->getLuceneExe()}\""." -install \"".$this->getName()."\" \"".$this->getJavaJVM(). "\" -Djava.class.path=\"". $this->getLuceneSource()."\"". " -start ".$this->getLuceneServer(). " -out \"".$this->getLuceneOut()."\" -err \"".$this->getLuceneError()."\" -current \"".$this->getluceneDir()."\" -auto"; + $response = $this->util->pexec($cmd); - return $response; + return $response; + } + + return $state; } } diff --git a/setup/wizard/lib/services/windowsScheduler.php b/setup/wizard/lib/services/windowsScheduler.php index a594df3..6bc7567 100755 --- a/setup/wizard/lib/services/windowsScheduler.php +++ b/setup/wizard/lib/services/windowsScheduler.php @@ -179,17 +179,21 @@ class windowsScheduler extends windowsService { * @return array */ public function install() { - $fp = fopen($this->getSchedulerScriptPath(), "w+"); - $content = "@echo off\n"; - $content .= "\"".PHP_DIR."php.exe\" "."\"{$this->getSchedulerSource()}\""; - fwrite($fp, $content); - fclose($fp); - $response = win32_create_service(array( - 'service' => $this->name, - 'display' => $this->name, - 'path' => $this->getSchedulerSource() - )); - return $response; + $state = $this->status(); + if($state == '') { + $fp = fopen($this->getSchedulerScriptPath(), "w+"); + $content = "@echo off\n"; + $content .= "\"".PHP_DIR."php.exe\" "."\"{$this->getSchedulerSource()}\""; + fwrite($fp, $content); + fclose($fp); + $response = win32_create_service(array( + 'service' => $this->name, + 'display' => $this->name, + 'path' => $this->getSchedulerScriptPath() + )); + return $response; + } + return $state; } } ?> \ No newline at end of file diff --git a/setup/wizard/lib/services/windowsService.php b/setup/wizard/lib/services/windowsService.php index 38d0751..8a163c2 100755 --- a/setup/wizard/lib/services/windowsService.php +++ b/setup/wizard/lib/services/windowsService.php @@ -125,7 +125,7 @@ class windowsService extends Service { * @author KnowledgeTree Team * @access public * @param none - * @return array + * @return string */ public function status() { $cmd = "sc query {$this->name}"; @@ -134,6 +134,8 @@ class windowsService extends Service { $state = preg_replace('/^STATE *\: *\d */', '', trim($response['out'][3])); // Status store in third key return $state; } + + return ''; } /** diff --git a/setup/wizard/steps/services.php b/setup/wizard/steps/services.php index 12f252a..e8f31da 100755 --- a/setup/wizard/steps/services.php +++ b/setup/wizard/steps/services.php @@ -66,6 +66,15 @@ class services extends Step protected $util; + /** + * Flag to store class information in session + * + * @author KnowledgeTree Team + * @access public + * @var boolean + */ + protected $storeInSession = false; + public $temp_variables; /**