You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2014/08/20 17:30:38 UTC

[37/50] [abbrv] git commit: AMBARI-6919. Start/Stop services fails after ambari upgrade 1.6.0->1.7.0, 1.6.1->1.7.0. On clean cluster too.(vbrodetskyi)

AMBARI-6919. Start/Stop services fails after ambari upgrade 1.6.0->1.7.0, 1.6.1->1.7.0. On clean cluster too.(vbrodetskyi)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/127eec22
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/127eec22
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/127eec22

Branch: refs/heads/branch-alerts-dev
Commit: 127eec229ed03414776d16cccad7d486a9bb112c
Parents: f72b323
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Wed Aug 20 13:05:17 2014 +0300
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Wed Aug 20 13:05:17 2014 +0300

----------------------------------------------------------------------
 ambari-agent/conf/unix/install-helper.sh        |  6 +++++
 ambari-agent/pom.xml                            |  4 ++++
 .../src/main/package/rpm/posttrans_agent.sh     | 25 ++++++++++++++++++++
 ambari-server/conf/unix/install-helper.sh       |  6 +++++
 ambari-server/pom.xml                           |  4 ++++
 .../src/main/package/rpm/posttrans_server.sh    | 25 ++++++++++++++++++++
 6 files changed, 70 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/127eec22/ambari-agent/conf/unix/install-helper.sh
----------------------------------------------------------------------
diff --git a/ambari-agent/conf/unix/install-helper.sh b/ambari-agent/conf/unix/install-helper.sh
index c2d2a3d..497db8d 100644
--- a/ambari-agent/conf/unix/install-helper.sh
+++ b/ambari-agent/conf/unix/install-helper.sh
@@ -34,6 +34,12 @@ do_install(){
   if [ ! -d "$COMMON_DIR" ]; then
     ln -s "$COMMON_DIR_AGENT" "$COMMON_DIR"
   fi
+  # remove RESOURCE_MANAGEMENT_DIR if it's a directory
+  if [ -d "$RESOURCE_MANAGEMENT_DIR" ]; then  # resource_management dir exists
+    if [ ! -L "$RESOURCE_MANAGEMENT_DIR" ]; then # resource_management dir is not link
+      rm -rf "$RESOURCE_MANAGEMENT_DIR"
+    fi
+  fi
   # setting resource_management shared resource
   if [ ! -d "$RESOURCE_MANAGEMENT_DIR" ]; then
     ln -s "$RESOURCE_MANAGEMENT_DIR_AGENT" "$RESOURCE_MANAGEMENT_DIR"

http://git-wip-us.apache.org/repos/asf/ambari/blob/127eec22/ambari-agent/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml
index c98af34..ebf30fa 100644
--- a/ambari-agent/pom.xml
+++ b/ambari-agent/pom.xml
@@ -198,6 +198,10 @@
             <scriptFile>src/main/package/rpm/preremove.sh</scriptFile>
             <fileEncoding>utf-8</fileEncoding>
           </preremoveScriptlet>
+          <posttransScriptlet>
+            <scriptFile>src/main/package/rpm/posttrans_agent.sh</scriptFile>
+            <fileEncoding>utf-8</fileEncoding>
+          </posttransScriptlet>
 
           <needarch>x86_64</needarch>
           <autoRequires>false</autoRequires>

http://git-wip-us.apache.org/repos/asf/ambari/blob/127eec22/ambari-agent/src/main/package/rpm/posttrans_agent.sh
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/package/rpm/posttrans_agent.sh b/ambari-agent/src/main/package/rpm/posttrans_agent.sh
new file mode 100644
index 0000000..15f824b
--- /dev/null
+++ b/ambari-agent/src/main/package/rpm/posttrans_agent.sh
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License
+
+
+RESOURCE_MANAGEMENT_DIR="/usr/lib/python2.6/site-packages/resource_management"
+RESOURCE_MANAGEMENT_DIR_AGENT="/usr/lib/ambari-agent/lib/resource_management"
+
+# setting resource_management shared resource
+if [ ! -d "$RESOURCE_MANAGEMENT_DIR" ]; then
+  ln -s "$RESOURCE_MANAGEMENT_DIR_AGENT" "$RESOURCE_MANAGEMENT_DIR"
+fi
+
+exit 0
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/127eec22/ambari-server/conf/unix/install-helper.sh
----------------------------------------------------------------------
diff --git a/ambari-server/conf/unix/install-helper.sh b/ambari-server/conf/unix/install-helper.sh
index dafe987..30946a5 100644
--- a/ambari-server/conf/unix/install-helper.sh
+++ b/ambari-server/conf/unix/install-helper.sh
@@ -33,6 +33,12 @@ do_install(){
   if [ ! -d "$COMMON_DIR" ]; then
     ln -s "$COMMON_DIR_SERVER" "$COMMON_DIR"
   fi
+  # remove RESOURCE_MANAGEMENT_DIR if it's a directory
+  if [ -d "$RESOURCE_MANAGEMENT_DIR" ]; then  # resource_management dir exists
+    if [ ! -L "$RESOURCE_MANAGEMENT_DIR" ]; then # resource_management dir is not link
+      rm -rf "$RESOURCE_MANAGEMENT_DIR"
+    fi
+  fi
   # setting resource_management shared resource
   if [ ! -d "$RESOURCE_MANAGEMENT_DIR" ]; then
     ln -s "$RESOURCE_MANAGEMENT_DIR_SERVER" "$RESOURCE_MANAGEMENT_DIR"

http://git-wip-us.apache.org/repos/asf/ambari/blob/127eec22/ambari-server/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 2ec71ab..2302c62 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -230,6 +230,10 @@
             <scriptFile>src/main/package/rpm/preremove.sh</scriptFile>
             <fileEncoding>utf-8</fileEncoding>
           </preremoveScriptlet>
+          <posttransScriptlet>
+            <scriptFile>src/main/package/rpm/posttrans_server.sh</scriptFile>
+            <fileEncoding>utf-8</fileEncoding>
+          </posttransScriptlet>
           <defaultFilemode>644</defaultFilemode>
           <defaultDirmode>755</defaultDirmode>
           <defaultUsername>root</defaultUsername>

http://git-wip-us.apache.org/repos/asf/ambari/blob/127eec22/ambari-server/src/main/package/rpm/posttrans_server.sh
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/package/rpm/posttrans_server.sh b/ambari-server/src/main/package/rpm/posttrans_server.sh
new file mode 100644
index 0000000..43478f4
--- /dev/null
+++ b/ambari-server/src/main/package/rpm/posttrans_server.sh
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License
+
+
+RESOURCE_MANAGEMENT_DIR="/usr/lib/python2.6/site-packages/resource_management"
+RESOURCE_MANAGEMENT_DIR_SERVER="/usr/lib/ambari-server/lib/resource_management"
+
+# setting resource_management shared resource
+if [ ! -d "$RESOURCE_MANAGEMENT_DIR" ]; then
+  ln -s "$RESOURCE_MANAGEMENT_DIR_SERVER" "$RESOURCE_MANAGEMENT_DIR"
+fi
+
+exit 0
\ No newline at end of file