From 4cd9aff8d8198a2b09142f68c2018d331792b792 Mon Sep 17 00:00:00 2001 From: jsatoh Date: Tue, 17 Aug 2010 01:58:46 +0000 Subject: [PATCH] 2010-08-17 Junichi Satoh * unix/pandora_agent_daemon, unix/tentacle_client: Added support for Solaris virtualization, "zone". git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3144 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_agents/ChangeLog | 5 +++++ pandora_agents/unix/ChangeLog | 5 +++++ pandora_agents/unix/pandora_agent_daemon | 19 ++++++++++++++++++- pandora_agents/unix/tentacle_client | 2 ++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/pandora_agents/ChangeLog b/pandora_agents/ChangeLog index 14e19d81d3..1c2ecbe44e 100644 --- a/pandora_agents/ChangeLog +++ b/pandora_agents/ChangeLog @@ -1,3 +1,8 @@ +2010-08-17 Junichi Satoh + + * unix/pandora_agent_daemon, unix/tentacle_client: Added support for + Solaris virtualization, "zone". + 2010-08-04 Dario Rodriguez * win32/bin/collections: Added collections directory. diff --git a/pandora_agents/unix/ChangeLog b/pandora_agents/unix/ChangeLog index 55c0a2b28d..bf560e0dbb 100644 --- a/pandora_agents/unix/ChangeLog +++ b/pandora_agents/unix/ChangeLog @@ -1,3 +1,8 @@ +2010-08-17 Junichi Satoh + + * pandora_agent_daemon, tentacle_client: Added support for Solaris + virtualization, "zone". + 2010-08-11 Ramon Novoa * pandora_agent: Fixed collection issues related to the agent. See diff --git a/pandora_agents/unix/pandora_agent_daemon b/pandora_agents/unix/pandora_agent_daemon index 11d7597478..205473e338 100755 --- a/pandora_agents/unix/pandora_agent_daemon +++ b/pandora_agents/unix/pandora_agent_daemon @@ -35,7 +35,24 @@ pidof_pandora () { then PANDORA_PID=`ps -ex | grep "$DAEMON $PANDORA_PATH" | grep -v grep | head -1 | awk '{ print $1 }'` else - PANDORA_PID=`ps -Af | grep "$DAEMON $PANDORA_PATH" | grep -v grep | head -1 | awk '{ print $2 }'` + if [ "$OS_NAME" = "SunOS" ] + then + ZONENAME_CMD="/bin/zonename" + if [ -x $ZONENAME_CMD ] + then + ZONE=`$ZONENAME_CMD` + else + ZONE= + fi + if [ "$ZONE" = "global" ] + then + PANDORA_PID=`ps -f -z global | grep "$DAEMON $PANDORA_PATH" | grep -v grep | head -1 | awk '{ print $2 }'` + else + PANDORA_PID=`ps -Af | grep "$DAEMON $PANDORA_PATH" | grep -v grep | head -1 | awk '{ print $2 }'` + fi + else + PANDORA_PID=`ps -Af | grep "$DAEMON $PANDORA_PATH" | grep -v grep | head -1 | awk '{ print $2 }'` + fi fi echo $PANDORA_PID diff --git a/pandora_agents/unix/tentacle_client b/pandora_agents/unix/tentacle_client index 492e96a463..27848c5ee1 100755 --- a/pandora_agents/unix/tentacle_client +++ b/pandora_agents/unix/tentacle_client @@ -271,9 +271,11 @@ sub parse_options { sub start_client { # Connect to server + # Note: "Type => SOCK_STREAM" should be clearly defined for Solaris zone. $t_socket = IO::Socket::INET->new ( PeerAddr => $t_address, PeerPort => $t_port, + Type => SOCK_STREAM, ); if (! defined ($t_socket)) {