From 33bcd0069e1c051def4253bd310eac619405b929 Mon Sep 17 00:00:00 2001
From: Falko Timme <ft@falkotimme.com>
Date: Mon, 21 Oct 2013 05:41:19 -0400
Subject: [PATCH] - Added support for systemd and upstart (besides sysvinit).

---
 server/mods-available/rescue_core_module.inc.php |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/server/mods-available/rescue_core_module.inc.php b/server/mods-available/rescue_core_module.inc.php
index 49012d5..15abd54 100644
--- a/server/mods-available/rescue_core_module.inc.php
+++ b/server/mods-available/rescue_core_module.inc.php
@@ -363,6 +363,7 @@
 	private function _rescueDaemon($daemon){
 		global $conf;
 		
+		$app->uses('system');
 		// if you need to find all restarts search for "['init_scripts']"
 		/*
 		 * First we stop the running service "normally"
@@ -374,7 +375,7 @@
 		 * So we have to try to stop but if this will not work, we have to kill the stopping
 		 * of the service
 		 */
-		exec($conf['init_scripts'] . '/' . $daemon . ' stop && (sleep 3; kill $!; sleep 2; kill -9 $!) &> /dev/null');
+		exec($app->system->getinitcommand($daemon, 'stop').' && (sleep 3; kill $!; sleep 2; kill -9 $!) &> /dev/null');
 		
 		/*
 		 * OK, we tryed to stop it normally, maybe this worked maybe not. So we have to look
@@ -385,7 +386,7 @@
 		/*
 		 * There are no more zombies left. Lets start the service..
 		 */
-		exec($conf['init_scripts'] . '/' . $daemon . ' start');
+		exec($app->system->getinitcommand($daemon, 'start'));
 	}
 }
 ?>

--
Gitblit v1.9.1