aboutsummaryrefslogtreecommitdiffstats
path: root/config/haproxy-devel/pkg/haproxy_socketinfo.inc
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-12-14 09:54:15 -0200
committerRenato Botelho <renato@netgate.com>2015-12-14 09:54:15 -0200
commitc2af83de50861c06434b569a95b75af8da1b21df (patch)
tree02c92a8a8ea838e4cc87c3359da54d4ba3eb7bed /config/haproxy-devel/pkg/haproxy_socketinfo.inc
parent4f0db58132b8aeeb483b31b3f35b7fae98b63316 (diff)
parenteeb48a38bb2600a1ab8f37158ebee72a5a737944 (diff)
downloadpfsense-packages-c2af83de50861c06434b569a95b75af8da1b21df.tar.gz
pfsense-packages-c2af83de50861c06434b569a95b75af8da1b21df.tar.bz2
pfsense-packages-c2af83de50861c06434b569a95b75af8da1b21df.zip
Merge pull request #1215 from PiBa-NL/haproxy_pkg0.32
Diffstat (limited to 'config/haproxy-devel/pkg/haproxy_socketinfo.inc')
-rw-r--r--config/haproxy-devel/pkg/haproxy_socketinfo.inc6
1 files changed, 5 insertions, 1 deletions
diff --git a/config/haproxy-devel/pkg/haproxy_socketinfo.inc b/config/haproxy-devel/pkg/haproxy_socketinfo.inc
index cbfb131b..7dbb6221 100644
--- a/config/haproxy-devel/pkg/haproxy_socketinfo.inc
+++ b/config/haproxy-devel/pkg/haproxy_socketinfo.inc
@@ -40,14 +40,18 @@ $show_clients_traffic = "YES";
function haproxy_socket_command($command){
$result = array();
if (file_exists("/tmp/haproxy.socket")) {
- $socket = stream_socket_client('unix:///tmp/haproxy.socket', $errno, $errstr);
+ $socket = @stream_socket_client('unix:///tmp/haproxy.socket', $errno, $errstr);
if ($socket) {
fwrite($socket, "$command\n");
while (!feof($socket)) {
$result[] = fgets($socket);
}
fclose($socket);
+ } else {
+ echo "cannot open command socket, haproxy not running? ({$errstr})";
}
+ } else {
+ echo "haproxy command socket does not exist, haproxy not running?";
}
return $result;
}