ソースを参照

AMBARI-11947. ambari-agent 2.0.1 overwrites /etc/sudoers.d/ambar-agent if it is exists (aonishuk)

Andrew Onishuk 10 年 前
コミット
058983f10f

+ 0 - 8
ambari-agent/conf/unix/install-helper.sh

@@ -31,7 +31,6 @@ SIMPLEJSON_AGENT_DIR="/usr/lib/ambari-agent/lib/ambari_simplejson"
 
 PYTHON_WRAPER_TARGET="/usr/bin/ambari-python-wrap"
 PYTHON_WRAPER_SOURCE="/var/lib/ambari-agent/ambari-python-wrap"
-SUDOERS_FILE="/etc/sudoers.d/ambari-agent"
 
 do_install(){
   # setting ambari_commons shared resource
@@ -56,13 +55,6 @@ do_install(){
     ln -s "$PYTHON_WRAPER_SOURCE" "$PYTHON_WRAPER_TARGET"
   fi
   
-  chmod 440 "$SUDOERS_FILE"
-  
-  grep '^#includedir /etc/sudoers.d$' /etc/sudoers > /dev/null
-  if [ $? -ne 0 ] ; then
-    echo '#includedir /etc/sudoers.d' >> /etc/sudoers
-  fi
-  
   # on nano Ubuntu, when umask=027 those folders are created without 'x' bit for 'others'.
   # which causes failures when hadoop users try to access tmp_dir
   chmod a+x /var/lib/ambari-agent

+ 0 - 1
ambari-agent/etc/sudoers.d/ambari-agent

@@ -1 +0,0 @@
-Defaults:root !requiretty

+ 0 - 23
ambari-agent/pom.xml

@@ -51,7 +51,6 @@
     <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>
@@ -416,17 +415,6 @@
                 </source>
               </sources>
             </mapping>
-            <mapping>
-              <directory>${sudoers.d.dir}</directory>
-              <username>root</username>
-              <groupname>root</groupname>
-              <directoryIncluded>false</directoryIncluded>
-              <sources>
-                <source>
-                  <location>etc/sudoers.d</location>
-                </source>
-              </sources>
-            </mapping>
             <mapping>
               <directory>/var/lib/${project.artifactId}/data</directory>
               <filemode>755</filemode>
@@ -540,16 +528,6 @@
                   <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>
@@ -765,7 +743,6 @@
             <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>