You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2015/05/05 12:59:57 UTC
ambari git commit: AMBARI-10771. Agent upgrade loses custom hostname
config (aonishuk)
Repository: ambari
Updated Branches:
refs/heads/branch-2.0.maint c33342c80 -> 68289c47c
AMBARI-10771. Agent upgrade loses custom hostname config (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/68289c47
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/68289c47
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/68289c47
Branch: refs/heads/branch-2.0.maint
Commit: 68289c47c73e8b62114250e8ef737060116eef01
Parents: c33342c
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Tue May 5 13:59:23 2015 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Tue May 5 13:59:23 2015 +0300
----------------------------------------------------------------------
ambari-agent/conf/unix/upgrade_agent_configs.py | 51 ++
ambari-agent/pom.xml | 22 +
ambari-agent/pom.xml.orig | 885 +++++++++++++++++++
.../src/main/package/deb/control/postinst | 7 +-
.../src/main/package/rpm/postinstall.sh | 7 +-
5 files changed, 966 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/68289c47/ambari-agent/conf/unix/upgrade_agent_configs.py
----------------------------------------------------------------------
diff --git a/ambari-agent/conf/unix/upgrade_agent_configs.py b/ambari-agent/conf/unix/upgrade_agent_configs.py
new file mode 100644
index 0000000..8b7be7a
--- /dev/null
+++ b/ambari-agent/conf/unix/upgrade_agent_configs.py
@@ -0,0 +1,51 @@
+#!/usr/bin/ambari-python-wrap
+'''
+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.
+'''
+
+import os
+import ConfigParser
+
+PROPERTIES_TO_REWRITE = [
+ ('heartbeat', 'dirs')
+]
+
+CONFIG_FILE_BACKUP = '/etc/ambari-agent/conf/ambari-agent.ini.old'
+CONFIG_FILE = '/etc/ambari-agent/conf/ambari-agent.ini'
+
+if os.path.isfile(CONFIG_FILE_BACKUP):
+ if os.path.isfile(CONFIG_FILE):
+ print "Upgrading configs in {0}".format(CONFIG_FILE)
+ print "Values will be updated from {0} except the following list: {1}".format(CONFIG_FILE_BACKUP, PROPERTIES_TO_REWRITE)
+
+ agent_config_backup = ConfigParser.ConfigParser()
+ agent_config_backup.read(CONFIG_FILE_BACKUP)
+
+ agent_config = ConfigParser.ConfigParser()
+ agent_config.read(CONFIG_FILE)
+
+ for section in agent_config_backup.sections():
+ for (property_name, property_val) in agent_config_backup.items(section):
+ if (section, property_name) not in PROPERTIES_TO_REWRITE:
+ agent_config.set(section, property_name, property_val)
+
+ with (open(CONFIG_FILE, "wb")) as new_agent_config:
+ agent_config.write(new_agent_config)
+ else:
+ print "Values are not updated, configs {0} is not found".format(CONFIG_FILE)
+else:
+ print "Values are not updated, backup {0} is not found".format(CONFIG_FILE_BACKUP)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/68289c47/ambari-agent/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-agent/pom.xml b/ambari-agent/pom.xml
index b170890..891029e 100644
--- a/ambari-agent/pom.xml
+++ b/ambari-agent/pom.xml
@@ -341,6 +341,17 @@
</sources>
</mapping>
<mapping>
+ <directory>/var/lib/ambari-agent</directory>
+ <filemode>700</filemode>
+ <username>root</username>
+ <groupname>root</groupname>
+ <sources>
+ <source>
+ <location>conf/unix/upgrade_agent_configs.py</location>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
<directory>${package.pid.dir}</directory>
<filemode>755</filemode>
<username>root</username>
@@ -521,6 +532,17 @@
</mapper>
</data>
<data>
+ <src>conf/unix/upgrade_agent_configs.py</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>/var/lib/ambari-agent</prefix>
+ <user>root</user>
+ <group>root</group>
+ <filemode>700</filemode>
+ </mapper>
+ </data>
+ <data>
<type>template</type>
<paths>
<path>${package.pid.dir}</path>
http://git-wip-us.apache.org/repos/asf/ambari/blob/68289c47/ambari-agent/pom.xml.orig
----------------------------------------------------------------------
diff --git a/ambari-agent/pom.xml.orig b/ambari-agent/pom.xml.orig
new file mode 100644
index 0000000..b170890
--- /dev/null
+++ b/ambari-agent/pom.xml.orig
@@ -0,0 +1,885 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <!--
+ 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.
+-->
+ <parent>
+ <groupId>org.apache.ambari</groupId>
+ <artifactId>ambari-project</artifactId>
+ <version>2.0.0.0</version>
+ <relativePath>../ambari-project</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.ambari</groupId>
+ <artifactId>ambari-agent</artifactId>
+ <packaging>pom</packaging>
+ <version>2.0.0.0</version>
+ <name>Ambari Agent</name>
+ <description>Ambari Agent</description>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <final.name>${project.artifactId}-${project.version}</final.name>
+ <package.release>1</package.release>
+ <package.prefix>/usr</package.prefix>
+ <package.log.dir>/var/log/ambari-agent</package.log.dir>
+ <package.pid.dir>/var/run/ambari-agent</package.pid.dir>
+ <skipTests>false</skipTests>
+ <agent.install.dir>/usr/lib/python2.6/site-packages/ambari_agent</agent.install.dir>
+ <ambari_commons.install.dir>/usr/lib/ambari-agent/lib/ambari_commons</ambari_commons.install.dir>
+ <resource_management.install.dir>/usr/lib/ambari-agent/lib/resource_management</resource_management.install.dir>
+ <jinja.install.dir>/usr/lib/ambari-agent/lib/ambari_jinja2</jinja.install.dir>
+ <lib.dir>/usr/lib/ambari-agent/lib</lib.dir>
+ <python.ver>python >= 2.6</python.ver>
+ <deb.python.ver>python (>= 2.6)</deb.python.ver>
+ <deb.architecture>amd64</deb.architecture>
+ <deb.dependency.list>openssl, zlibc, ${deb.python.ver}</deb.dependency.list>
+ <ambari.server.module>../ambari-server</ambari.server.module>
+ <target.cache.dir>${project.build.directory}/cache/</target.cache.dir>
+ <resource.keeper.script>${ambari.server.module}/src/main/python/ambari_server/resourceFilesKeeper.py</resource.keeper.script>
+ <init.d.dir>/etc/rc.d/init.d</init.d.dir>
+ <sudoers.d.dir>/etc/sudoers.d</sudoers.d.dir>
+ </properties>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.8</version>
+ <executions>
+ <execution>
+ <id>parse-version</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>parse-version</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>regex-property</id>
+ <goals>
+ <goal>regex-property</goal>
+ </goals>
+ <configuration>
+ <name>ambariVersion</name>
+ <value>${project.version}</value>
+ <regex>^([0-9]+)\.([0-9]+)\.([0-9]+)(\.|-).*</regex>
+ <replacement>$1.$2.$3</replacement>
+ <failIfNoMatch>false</failIfNoMatch>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.0</version>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <tarLongFileMode>gnu</tarLongFileMode>
+ <descriptors>
+ <descriptor>src/packages/tarball/all.xml</descriptor>
+ </descriptors>
+ </configuration>
+ <executions>
+ <execution>
+ <id>build-tarball</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>${skipSurefireTests}</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.2</version>
+ <executions>
+ <execution>
+ <configuration>
+ <executable>${executable.python}</executable>
+ <workingDirectory>src/test/python</workingDirectory>
+ <arguments>
+ <argument>unitTests.py</argument>
+ </arguments>
+ <environmentVariables>
+ <PYTHONPATH>${path.python.1}${pathsep}$PYTHONPATH</PYTHONPATH>
+ </environmentVariables>
+ <skip>${skipTests}</skip>
+ </configuration>
+ <id>python-test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ </execution>
+ <execution>
+ <!-- TODO: Looks like section is unused, maybe remove? -->
+ <configuration>
+ <executable>${executable.python}</executable>
+ <workingDirectory>target${dirsep}ambari-agent-${project.version}</workingDirectory>
+ <arguments>
+ <argument>${project.basedir}${dirsep}src${dirsep}main${dirsep}python${dirsep}setup.py</argument>
+ <argument>clean</argument>
+ <argument>bdist_dumb</argument>
+ </arguments>
+ <environmentVariables>
+ <PYTHONPATH>target${dirsep}ambari-agent-${project.version}${pathsep}$PYTHONPATH</PYTHONPATH>
+ </environmentVariables>
+ </configuration>
+ <id>python-package</id>
+ <phase>package</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ </execution>
+ <execution>
+ <configuration>
+ <executable>${executable.python}</executable>
+ <workingDirectory>${basedir}</workingDirectory>
+ <arguments>
+ <argument>${resource.keeper.script}</argument>
+ <argument>${target.cache.dir}</argument>
+ </arguments>
+ <environmentVariables>
+ <PYTHONPATH>target${dirsep}ambari-agent-${project.version}${pathsep}$PYTHONPATH</PYTHONPATH>
+ </environmentVariables>
+ </configuration>
+ <id>generate-hash-files</id>
+ <phase>package</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>rpm-maven-plugin</artifactId>
+ <version>2.0.1</version>
+ <executions>
+ <execution>
+ <!-- unbinds rpm creation from maven lifecycle -->
+ <phase>none</phase>
+ <goals>
+ <goal>rpm</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <copyright>2012, Apache Software Foundation</copyright>
+ <group>Development</group>
+ <description>Maven Recipe: RPM Package.</description>
+ <requires>
+ <require>openssl</require>
+ <require>zlib</require>
+ <require>${python.ver}</require>
+ </requires>
+ <postinstallScriptlet>
+ <scriptFile>src/main/package/rpm/postinstall.sh</scriptFile>
+ <fileEncoding>utf-8</fileEncoding>
+ </postinstallScriptlet>
+ <preinstallScriptlet>
+ <scriptFile>src/main/package/rpm/preinstall.sh</scriptFile>
+ <fileEncoding>utf-8</fileEncoding>
+ </preinstallScriptlet>
+ <preremoveScriptlet>
+ <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>
+ <mappings>
+ <mapping>
+ <directory>${agent.install.dir}</directory>
+ <username>root</username>
+ <groupname>root</groupname>
+ <sources>
+ <source>
+ <location>${project.build.directory}${dirsep}${project.artifactId}-${project.version}${dirsep}ambari_agent</location>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>/var/lib/ambari-agent/</directory>
+ <filemode>755</filemode>
+ <username>root</username>
+ <groupname>root</groupname>
+ <directoryIncluded>false</directoryIncluded>
+ <sources>
+ <source>
+ <location>../ambari-common/src/main/unix/ambari-python-wrap</location>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>/var/lib/ambari-agent/</directory>
+ <filemode>755</filemode>
+ <username>root</username>
+ <groupname>root</groupname>
+ <directoryIncluded>false</directoryIncluded>
+ <sources>
+ <source>
+ <location>conf/unix/ambari-sudo.sh</location>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>${ambari_commons.install.dir}</directory>
+ <username>root</username>
+ <groupname>root</groupname>
+ <sources>
+ <source>
+ <location>${project.basedir}/../ambari-common/src/main/python/ambari_commons</location>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>${resource_management.install.dir}</directory>
+ <username>root</username>
+ <groupname>root</groupname>
+ <sources>
+ <source>
+ <location>${project.basedir}/../ambari-common/src/main/python/resource_management</location>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>${jinja.install.dir}</directory>
+ <filemode>755</filemode>
+ <username>root</username>
+ <groupname>root</groupname>
+ <sources>
+ <source>
+ <location>${project.basedir}/../ambari-common/src/main/python/ambari_jinja2/ambari_jinja2</location>
+ <excludes>
+ <exclude>${project.basedir}/../ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite</exclude>
+ </excludes>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>${lib.dir}/examples</directory>
+ <filemode>755</filemode>
+ <username>root</username>
+ <groupname>root</groupname>
+ <sources>
+ <source>
+ <location>src/examples</location>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>/etc/ambari-agent/conf</directory>
+ <filemode>755</filemode>
+ <username>root</username>
+ <groupname>root</groupname>
+ <sources>
+ <source>
+ <location>conf/unix/ambari-agent.ini</location>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>/usr/sbin</directory>
+ <filemode>755</filemode>
+ <username>root</username>
+ <groupname>root</groupname>
+ <directoryIncluded>false</directoryIncluded>
+ <sources>
+ <source>
+ <location>conf/unix/ambari-agent</location>
+ <filter>true</filter>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>/var/lib/ambari-agent</directory>
+ <filemode>700</filemode>
+ <username>root</username>
+ <groupname>root</groupname>
+ <sources>
+ <source>
+ <location>conf/unix/ambari-env.sh</location>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>/var/lib/ambari-agent</directory>
+ <filemode>700</filemode>
+ <username>root</username>
+ <groupname>root</groupname>
+ <sources>
+ <source>
+ <location>conf/unix/install-helper.sh</location>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>${package.pid.dir}</directory>
+ <filemode>755</filemode>
+ <username>root</username>
+ <groupname>root</groupname>
+ </mapping>
+ <mapping>
+ <directory>/var/lib/${project.artifactId}/data</directory>
+ <filemode>755</filemode>
+ <username>root</username>
+ <groupname>root</groupname>
+ </mapping>
+ <mapping>
+ <directory>/var/lib/${project.artifactId}/data/tmp</directory>
+ <filemode>755</filemode>
+ <username>root</username>
+ <groupname>root</groupname>
+ </mapping>
+ <mapping>
+ <directory>/var/lib/${project.artifactId}/keys</directory>
+ <filemode>755</filemode>
+ <username>root</username>
+ <groupname>root</groupname>
+ </mapping>
+ <mapping>
+ <directory>${package.log.dir}</directory>
+ <filemode>755</filemode>
+ <username>root</username>
+ <groupname>root</groupname>
+ </mapping>
+ <mapping>
+ <directory>${init.d.dir}</directory>
+ <filemode>755</filemode>
+ <username>root</username>
+ <groupname>root</groupname>
+ <sources>
+ <source>
+ <location>etc/init.d/ambari-agent</location>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>${sudoers.d.dir}</directory>
+ <username>root</username>
+ <groupname>root</groupname>
+ <sources>
+ <source>
+ <location>etc/sudoers.d</location>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>/var/lib/${project.artifactId}/data</directory>
+ <filemode>755</filemode>
+ <username>root</username>
+ <groupname>root</groupname>
+ <sources>
+ <source>
+ <location>../version</location>
+ <filter>true</filter>
+ </source>
+ </sources>
+ </mapping>
+ <mapping>
+ <directory>/var/lib/ambari-agent/cache</directory>
+ <filemode>755</filemode>
+ <username>root</username>
+ <groupname>root</groupname>
+ <sources>
+ <source>
+ <location>${target.cache.dir}</location>
+ </source>
+ </sources>
+ </mapping>
+ </mappings>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.vafer</groupId>
+ <artifactId>jdeb</artifactId>
+ <version>1.0.1</version>
+ <executions>
+ <execution>
+ <phase>none</phase>
+ <goals>
+ <goal>jdeb</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <controlDir>${basedir}/src/main/package/deb/control</controlDir>
+ <deb>${basedir}/target/${artifactId}_${package-version}-${package-release}.deb</deb>
+ <dataSet>
+ <data>
+ <src>${project.build.directory}/${project.artifactId}-${project.version}/ambari_agent</src>
+ <type>directory</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>${agent.install.dir}</prefix>
+ <user>root</user>
+ <group>root</group>
+ </mapper>
+ </data>
+ <data>
+ <src>${project.basedir}/../ambari-common/src/main/python/ambari_jinja2/ambari_jinja2</src>
+ <excludes>${project.basedir}/../ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite</excludes>
+ <type>directory</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>${jinja.install.dir}</prefix>
+ <user>root</user>
+ <group>root</group>
+ <filemode>755</filemode>
+ </mapper>
+ </data>
+ <data>
+ <src>src/examples</src>
+ <type>directory</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>${lib.dir}/examples</prefix>
+ <user>root</user>
+ <group>root</group>
+ <filemode>755</filemode>
+ </mapper>
+ </data>
+ <data>
+ <src>conf/unix/ambari-agent.ini</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>/etc/ambari-agent/conf</prefix>
+ <user>root</user>
+ <group>root</group>
+ <filemode>755</filemode>
+ </mapper>
+ </data>
+ <data>
+ <src>etc/sudoers.d/ambari-agent</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>${sudoers.d.dir}</prefix>
+ <user>root</user>
+ <group>root</group>
+ </mapper>
+ </data>
+ <data>
+ <src>${basedir}/target/src/ambari-agent</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>/usr/sbin</prefix>
+ <user>root</user>
+ <group>root</group>
+ <filemode>755</filemode>
+ </mapper>
+ </data>
+ <data>
+ <src>conf/unix/ambari-env.sh</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>/var/lib/ambari-agent</prefix>
+ <user>root</user>
+ <group>root</group>
+ <filemode>700</filemode>
+ </mapper>
+ </data>
+ <data>
+ <src>conf/unix/install-helper.sh</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>/var/lib/ambari-agent</prefix>
+ <user>root</user>
+ <group>root</group>
+ <filemode>700</filemode>
+ </mapper>
+ </data>
+ <data>
+ <type>template</type>
+ <paths>
+ <path>${package.pid.dir}</path>
+ <path>/var/lib/${project.artifactId}/data</path>
+ <path>/var/lib/${project.artifactId}/data/tmp</path>
+ <path>/var/lib/${project.artifactId}/keys</path>
+ <path>${package.log.dir}</path>
+ </paths>
+ <mapper>
+ <type>perm</type>
+ <user>root</user>
+ <group>root</group>
+ <filemode>755</filemode>
+ </mapper>
+ </data>
+ <data>
+ <src>etc/init.d/ambari-agent</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>/etc/init.d</prefix>
+ <user>root</user>
+ <group>root</group>
+ <filemode>755</filemode>
+ </mapper>
+ </data>
+ <data>
+ <src>${basedir}/target/src/version</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>/var/lib/${project.artifactId}/data</prefix>
+ <user>root</user>
+ <group>root</group>
+ <filemode>755</filemode>
+ </mapper>
+ </data>
+ <data>
+ <src>../ambari-common/src/main/unix/ambari-python-wrap</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>/var/lib/ambari-agent</prefix>
+ <user>root</user>
+ <group>root</group>
+ <filemode>755</filemode>
+ </mapper>
+ </data>
+ <data>
+ <src>conf/unix/ambari-sudo.sh</src>
+ <type>file</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>/var/lib/ambari-agent</prefix>
+ <user>root</user>
+ <group>root</group>
+ <filemode>755</filemode>
+ </mapper>
+ </data>
+ <data>
+ <src>${target.cache.dir}</src>
+ <type>directory</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>/var/lib/ambari-agent/cache</prefix>
+ <user>root</user>
+ <group>root</group>
+ <filemode>755</filemode>
+ </mapper>
+ </data>
+ <data>
+ <src>
+ ${project.basedir}/../ambari-common/src/main/python/ambari_commons
+ </src>
+ <type>directory</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>${ambari_commons.install.dir}</prefix>
+ <filemode>755</filemode>
+ <user>root</user>
+ <group>root</group>
+ </mapper>
+ </data>
+ <data>
+ <src>
+ ${project.basedir}/../ambari-common/src/main/python/resource_management
+ </src>
+ <type>directory</type>
+ <mapper>
+ <type>perm</type>
+ <prefix>${resource_management.install.dir}</prefix>
+ <filemode>755</filemode>
+ <user>root</user>
+ <group>root</group>
+ </mapper>
+ </data>
+ </dataSet>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.6</version>
+ <executions>
+ <execution>
+ <id>copy-resources</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${target.cache.dir}</outputDirectory>
+ <resources>
+ <resource>
+ <directory>${ambari.server.module}/src/main/resources</directory>
+ <includes>
+ <include>common-services/**</include>
+ <include>stacks/stack_advisor.py</include>
+ <include>stacks/${stack.distribution}/**/*</include>
+ <include>custom_actions/**/*</include>
+ <include>host_scripts/**/*</include>
+ </includes>
+ <filtering>false</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ <execution>
+ <id>copy-resources-filter</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${basedir}/target/src</outputDirectory>
+ <resources>
+ <resource>
+ <directory>conf/unix</directory>
+ <includes>
+ <include>ambari-agent</include>
+ </includes>
+ <filtering>true</filtering>
+ </resource>
+ <resource>
+ <directory>${basedir}/../</directory>
+ <includes>
+ <include>version</include>
+ </includes>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>src/test/python/tmp_hostcheck.result</exclude>
+ <exclude>src/examples/*</exclude>
+ <exclude>src/test/python/dummy*.txt</exclude>
+ <exclude>src/test/python/ambari_agent/dummy_files/*</exclude>
+ <exclude>src/test/python/ambari_agent/dummy*.txt</exclude>
+ <exclude>src/main/python/ambari_agent/imports.txt</exclude>
+ <exclude>src/main/python/ambari_agent/apscheduler/**</exclude>
+ <exclude>etc/sudoers.d/ambari-agent</exclude>
+ <exclude>**/*.erb</exclude>
+ <exclude>**/*.json</exclude>
+ <exclude>**/*.pydevproject</exclude>
+ <exclude>**/*.wxs</exclude>
+ </excludes>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>test</phase>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>buildnumber-maven-plugin</artifactId>
+ <version>${buildnumber-maven-plugin-version}</version>
+ <configuration>
+ <urlScm>scm:git:https://git-wip-us.apache.org/repos/asf/incubator-ambari.git</urlScm>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>validate</phase>
+ <goals>
+ <goal>create</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-ssh-external</artifactId>
+ </extension>
+ </extensions>
+ </build>
+ <profiles>
+ <profile>
+ <id>windows</id>
+ <activation>
+ <os>
+ <family>win</family>
+ </os>
+ </activation>
+ <properties>
+ <envClassifier>win</envClassifier>
+ <dirsep>\</dirsep>
+ <pathsep>;</pathsep>
+ <stack.distribution>HDPWIN</stack.distribution>
+ <executable.python>python</executable.python>
+ <executable.shell>cmd</executable.shell>
+ <fileextension.shell>cmd</fileextension.shell>
+ <fileextension.dot.shell-default>.cmd</fileextension.dot.shell-default>
+ <path.python.1>${project.basedir}\..\ambari-common\src\main\python;${project.basedir}\..\ambari-agent\src\main\python;${project.basedir}\..\ambari-common\src\main\python\ambari_jinja2;${project.basedir}\..\ambari-common\src\main\python\ambari_commons;${project.basedir}\..\ambari-common\src\test\python;${project.basedir}\src\main\python;${project.basedir}\src\main\python\ambari_agent;${project.basedir}\src\main\python\resource_management;${project.basedir}\src\test\python;${project.basedir}\src\test\python\ambari_agent;${project.basedir}\src\test\python\resource_management;${project.basedir}\..\ambari-server\src\test\python;${project.basedir}\..\ambari-server\src\main\resources\common-services\HDFS\2.1.0.2.0\package\files</path.python.1>
+ </properties>
+ </profile>
+ <profile>
+ <id>linux</id>
+ <activation>
+ <os>
+ <family>unix</family>
+ </os>
+ </activation>
+ <properties>
+ <envClassifier>linux</envClassifier>
+ <dirsep>/</dirsep>
+ <pathsep>:</pathsep>
+ <stack.distribution>HDP</stack.distribution>
+ <executable.python>${project.basedir}/../ambari-common/src/main/unix/ambari-python-wrap</executable.python>
+ <executable.shell>sh</executable.shell>
+ <fileextension.shell>sh</fileextension.shell>
+ <fileextension.dot.shell-default></fileextension.dot.shell-default>
+ <path.python.1>${project.basedir}/../ambari-common/src/main/python:${project.basedir}/../ambari-agent/src/main/python:${project.basedir}/../ambari-common/src/main/python/ambari_jinja2:${project.basedir}/../ambari-common/src/main/python/ambari_commons:${project.basedir}/../ambari-common/src/test/python:${project.basedir}/src/main/python:${project.basedir}/src/main/python/ambari_agent:${project.basedir}/src/main/python/resource_management:${project.basedir}/src/test/python:${project.basedir}/src/test/python/ambari_agent:${project.basedir}/src/test/python/resource_management:${project.basedir}/../ambari-server/src/test/python:${project.basedir}/../ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/files</path.python.1>
+ </properties>
+ </profile>
+ <profile>
+ <id>windows-distro</id>
+ <activation>
+ <os>
+ <family>Windows</family>
+ </os>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <tarLongFileMode>gnu</tarLongFileMode>
+ <descriptors>
+ <descriptor>src/packages/tarball/all.xml</descriptor>
+ <descriptor>src/packages/windows.xml</descriptor>
+ </descriptors>
+ </configuration>
+ <executions>
+ <execution>
+ <id>build-windows-zip</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- msi creation -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.2</version>
+ <executions>
+ <execution>
+ <id>run-heat</id>
+ <phase>package</phase>
+ <goals>
+ <goal>exec</goal>
+ </goals>
+ <configuration>
+ <executable>heat.exe</executable>
+ <arguments>
+ <argument>dir</argument>
+ <argument>"."</argument>
+ <argument>-dr</argument>
+ <argument>"AGENT_INSTALL_DIRECTORY"</argument>
+ <argument>-platform</argument>
+ <argument>Win64</argument>
+ <argument>-cg</argument>
+ <argument>"AmbariAgentGroup"</argument>
+ <argument>-gg</argument>
+ <argument>-ke</argument>
+ <argument>-srd</argument>
+ <argument>-o</argument>
+ <argument>".\..\ambari-agent-files.wxs"</argument>
+ </arguments>
+ <workingDirectory>${basedir}/target/${final.name}-windows-dist</workingDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.npanday.plugins</groupId>
+ <artifactId>wix-maven-plugin</artifactId>
+ <version>1.4.0-incubating</version>
+ <extensions>true</extensions>
+ <configuration>
+ <sourceFiles>
+ <sourceFile>target/ambari-agent.wxs</sourceFile>
+ <sourceFile>target/ambari-agent-files.wxs</sourceFile>
+ </sourceFiles>
+ <outputDirectory>target</outputDirectory>
+ <objectFiles>
+ <objectFile>target/ambari-agent.wixobj</objectFile>
+ <objectFile>target/ambari-agent-files.wixobj</objectFile>
+ </objectFiles>
+ <outputFile>target/ambari-agent-${project.version}.msi</outputFile>
+ <extensions>
+ <extension>WixUIExtension</extension>
+ </extensions>
+ </configuration>
+ <executions>
+ <execution>
+ <id>wix-candle</id>
+ <phase>package</phase>
+ <goals>
+ <goal>candle</goal>
+ </goals>
+ <configuration>
+ <arguments>-arch x64</arguments>
+ </configuration>
+ </execution>
+ <execution>
+ <id>wix-light</id>
+ <phase>package</phase>
+ <goals>
+ <goal>light</goal>
+ </goals>
+ <configuration>
+ <arguments>-b ${basedir}/target/${final.name}-windows-dist</arguments>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- end msi creation -->
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>suse11</id>
+ <properties>
+ <init.d.dir>/etc/init.d</init.d.dir>
+ </properties>
+ </profile>
+ </profiles>
+</project>
http://git-wip-us.apache.org/repos/asf/ambari/blob/68289c47/ambari-agent/src/main/package/deb/control/postinst
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/package/deb/control/postinst b/ambari-agent/src/main/package/deb/control/postinst
index 69a09e8..ceca9be 100644
--- a/ambari-agent/src/main/package/deb/control/postinst
+++ b/ambari-agent/src/main/package/deb/control/postinst
@@ -25,8 +25,9 @@ BAK=/etc/ambari-agent/conf/ambari-agent.ini.old
ORIG=/etc/ambari-agent/conf/ambari-agent.ini
if [ -f $BAK ];then
- SERV_HOST=`grep -e hostname\s*= $BAK | sed -r -e 's/hostname\s*=//' -e 's/\./\\\./g'`
- sed -i -r -e "s/(hostname\s*=).*/\1$SERV_HOST/" $ORIG
- rm $BAK -f
+ if [ -f "/var/lib/ambari-agent/upgrade_agent_configs.py" ]; then
+ /var/lib/ambari-agent/upgrade_agent_configs.py
+ fi
+ mv $BAK ${BAK}_$(date '+%d_%m_%y_%H_%M').save
fi
exit 0
http://git-wip-us.apache.org/repos/asf/ambari/blob/68289c47/ambari-agent/src/main/package/rpm/postinstall.sh
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/package/rpm/postinstall.sh b/ambari-agent/src/main/package/rpm/postinstall.sh
index 53c5958..56c6573 100644
--- a/ambari-agent/src/main/package/rpm/postinstall.sh
+++ b/ambari-agent/src/main/package/rpm/postinstall.sh
@@ -38,9 +38,10 @@ BAK=/etc/ambari-agent/conf/ambari-agent.ini.old
ORIG=/etc/ambari-agent/conf/ambari-agent.ini
if [ -f $BAK ]; then
- SERV_HOST=`grep -e hostname\s*= $BAK | sed -r -e 's/hostname\s*=//' -e 's/\./\\\./g'`
- sed -i -r -e "s/(hostname\s*=).*/\1$SERV_HOST/" $ORIG
- rm $BAK -f
+ if [ -f "/var/lib/ambari-agent/upgrade_agent_configs.py" ]; then
+ /var/lib/ambari-agent/upgrade_agent_configs.py
+ fi
+ mv $BAK ${BAK}_$(date '+%d_%m_%y_%H_%M').save
fi