From 20e5a21e4bef9107c36b667b97aac689b66351e7 Mon Sep 17 00:00:00 2001 From: koichirok Date: Mon, 5 Sep 2011 09:52:18 +0000 Subject: [PATCH] 2011-09-05 Koichiro Kikuchi * pandora_agent_daemon: Added support for OpenVZ/Virtuozzo. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4898 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_agents/unix/ChangeLog | 4 ++++ pandora_agents/unix/pandora_agent_daemon | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/pandora_agents/unix/ChangeLog b/pandora_agents/unix/ChangeLog index 14ce105bb4..b43451494b 100644 --- a/pandora_agents/unix/ChangeLog +++ b/pandora_agents/unix/ChangeLog @@ -1,3 +1,7 @@ +2011-09-05 Koichiro Kikuchi + + * pandora_agent_daemon: Added support for OpenVZ/Virtuozzo. + 2011-09-02 Koichiro Kikuchi * pandora_agent: Now module_condition and module_precondition diff --git a/pandora_agents/unix/pandora_agent_daemon b/pandora_agents/unix/pandora_agent_daemon index d5ddb4abaf..c237568600 100755 --- a/pandora_agents/unix/pandora_agent_daemon +++ b/pandora_agents/unix/pandora_agent_daemon @@ -52,6 +52,17 @@ pidof_pandora () { else PANDORA_PID=`ps -Af | grep "$TRUNCATED_DAEMON" | grep -v grep | head -1 | awk '{ print $2 }'` fi + elif [ "$OS_NAME" = "Linux" -a -x /usr/sbin/vzpid ] + then + for _pid in `ps -Af | grep "$DAEMON $PANDORA_PATH" | grep -v grep | awk '{ print $2 }'` + do + _ctid=`/usr/sbin/vzpid $_pid | awk '$1 == '$_pid' { print $2 }'` + if [ "X$_ctid" = "X0" ] + then + PANDORA_PID=$_pid + break + fi + done else PANDORA_PID=`ps -Af | grep "$DAEMON $PANDORA_PATH" | grep -v grep | head -1 | awk '{ print $2 }'` fi