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 2014/04/17 21:40:21 UTC

git commit: AMBARI-5501. Hdfs Service Start fail due bad snmpd usage for Ubuntu (aonishuk)

Repository: ambari
Updated Branches:
  refs/heads/trunk 384ce70c5 -> 04dc30283


AMBARI-5501. Hdfs Service Start fail due bad snmpd usage for Ubuntu (aonishuk)


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

Branch: refs/heads/trunk
Commit: 04dc3028390bd0ab09c346c12f731a60a4187e65
Parents: 384ce70
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Apr 17 22:34:47 2014 +0300
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Thu Apr 17 22:34:47 2014 +0300

----------------------------------------------------------------------
 .../before-START/scripts/shared_initialization.py    | 15 ++++++++++++---
 .../2.0.6/hooks/before-START/test_before_start.py    | 10 ++++++----
 2 files changed, 18 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/04dc3028/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
index 6e34a95..e420f45 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-START/scripts/shared_initialization.py
@@ -183,6 +183,15 @@ def init_services():
   File(os.path.join(params.snmp_conf_dir, 'snmpd.conf'),
        content=Template("snmpd.conf.j2"))
   # enable snmpd
-  Execute( "service snmpd start; chkconfig snmpd on",
-    path = "/usr/local/bin/:/bin/:/sbin/"
-  )
\ No newline at end of file
+  Execute( "service snmpd start",
+  )
+  
+  if System.get_instance().os_family == "debian":
+    Execute( "update-rc.d snmpd defaults",
+    )    
+  else:
+    Execute( "chkconfig snmpd on",
+    )
+      
+  
+  
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/04dc3028/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
index 9841c3f..c49bb53 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-START/test_before_start.py
@@ -99,8 +99,9 @@ class TestHookBeforeStart(RMFTestCase):
     self.assertResourceCalled('File', '/etc/snmp/snmpd.conf',
                               content = Template('snmpd.conf.j2'),
                               )
-    self.assertResourceCalled('Execute', 'service snmpd start; chkconfig snmpd on',
-                              path = ['/usr/local/bin/:/bin/:/sbin/'],
+    self.assertResourceCalled('Execute', 'service snmpd start',
+                              )
+    self.assertResourceCalled('Execute', 'chkconfig snmpd on',
                               )
     self.assertNoMoreResources()
 
@@ -180,7 +181,8 @@ class TestHookBeforeStart(RMFTestCase):
     self.assertResourceCalled('File', '/etc/snmp/snmpd.conf',
                               content = Template('snmpd.conf.j2'),
                               )
-    self.assertResourceCalled('Execute', 'service snmpd start; chkconfig snmpd on',
-                            path = ['/usr/local/bin/:/bin/:/sbin/'],
+    self.assertResourceCalled('Execute', 'service snmpd start',
+                            )
+    self.assertResourceCalled('Execute', 'chkconfig snmpd on',
                             )
     self.assertNoMoreResources()