Location: PHPKode > projects > SCOP Heartbeat Administration interface > scop-2.0/html/scop/config/restart.php
<?
include ("../inc/header.inc");
$command = $_GET['service'];


	if ($service==heartbeat) {

$trans="85";
$a85 = "${$l.$trans}";

		SCOP_log("Config : Heartbeat re-started");
		exec ("sudo /etc/init.d/heartbeat restart > /dev/null 2>&1 &");
		//echo "<p>Heartbeat restarted ...</p><p><i>NB.Your floating VIPs may take up to 1 minute to activate.</i></p>";
		echo "<center><p>$a85</p></center>";
		ob_flush();
		flush();
		//Now do the same on the slave...
		exec ("sudo ssh slave /etc/init.d/heartbeat restart > /dev/null 2>&1 &");


	}

	if ($service==ldirectord) {
	$trans="86";
	$a86 = "${$l.$trans}";
		SCOP_log("Config : Ldirectord re-started");
		//echo "<p>Restarting Ldirectord...</p>";

	//flush();
		exec ("sudo /etc/init.d/ldirectord stop");
		//echo "<p>Ldirectord is stopped...</p>";

	//flush();
		exec ("sudo ipvsadm -C");
		//echo "<p>LVS table cleared...</p>";

	flush();
		exec ("sudo /etc/init.d/ldirectord start > /dev/null 2>&1 &");
		echo "<center><p>$a86</p></center>";


	}

	if ($service==haproxy) {
	$trans="109";
	$a109 = "${$l.$trans}";
		SCOP_log("Config : HAProxy re-loaded");
		
	echo "<center><p>$a109</p></center>";
	echo "<table width=\"60%\" align=\"center\"><tr><td>";
	$output = `sudo /usr/local/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid)`;
	echo "<pre>$output</pre>";

	echo "</td></tr></table>";
	}
	if ($service==pound) {
	$trans="110";
	$a110 = "${$l.$trans}";
		SCOP_log("Config : Pound-SSL re-loaded");
		
	echo "<center><p>$a109</p></center>";
	echo "<table width=\"60%\" align=\"center\"><tr><td>";
	$output = `sudo /etc/rc.d/init.d/pound restart`;
	echo "<pre>$output</pre>";

	echo "</td></tr></table>";

}

include ("../inc/footer.inc");
?>
Return current item: SCOP Heartbeat Administration interface