You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sm...@apache.org on 2013/04/06 01:03:16 UTC

svn commit: r1465152 - in /incubator/ambari/trunk: CHANGES.txt ambari-agent/src/main/puppet/modules/hdp-mysql/manifests/server.pp ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server.pp

Author: smohanty
Date: Fri Apr  5 23:03:15 2013
New Revision: 1465152

URL: http://svn.apache.org/r1465152
Log:
AMBARI-1826. Use service stop and start for Nagios/Ganglia/MySQL rather than puppet artifacts for starting stopping these services. (smohanty)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-mysql/manifests/server.pp
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server.pp

Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1465152&r1=1465151&r2=1465152&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Fri Apr  5 23:03:15 2013
@@ -560,6 +560,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-1826. Use service stop and start for Nagios/Ganglia/MySQL rather than
+ puppet artifacts for starting stopping these services. (smohanty)
+
  AMBARI-1818. HBase master shuts down immediately after start in a secure 
  cluster. (swagle)
 

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-mysql/manifests/server.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-mysql/manifests/server.pp?rev=1465152&r1=1465151&r2=1465152&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-mysql/manifests/server.pp (original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-mysql/manifests/server.pp Fri Apr  5 23:03:15 2013
@@ -79,19 +79,27 @@ class hdp-mysql::server(
       default =>  'stopped',
     }
 
+    if ($mysqld_state == 'running') {
+      $command = "service $service_name start"
+    } else {
+      $command = "service $service_name stop"
+    }
+
     if ($hdp::params::hdp_os_type == "suse") {
-      service {$service_name:
-        ensure => $mysqld_state,
+      exec { $service_name:
+        command => $command,
+        path    => "/usr/local/bin/:/bin/:/sbin/",
         require => File['/var/run/mysqld/mysqld.pid'],
         notify  => File['/tmp/addMysqlUser.sh']
-      }
-    } else {
-        service {$service_name:
-        ensure => $mysqld_state,
+       }
+     } else {
+      exec { $service_name:
+        command => $command,
+        path    => "/usr/local/bin/:/bin/:/sbin/", 
         require => Hdp::Package['mysql'],
         notify  => File['/tmp/addMysqlUser.sh']
-      }
-    }
+       }
+     }
 
 
     if ($service_state == 'installed_and_configured') {
@@ -100,7 +108,7 @@ class hdp-mysql::server(
         ensure => present,
         source => "puppet:///modules/hdp-mysql/addMysqlUser.sh",
         mode => '0755',
-        require => Service[$service_name],
+        require => Exec[$service_name],
         notify => Exec['/tmp/addMysqlUser.sh'],
       }
       # We start the DB and add a user
@@ -117,7 +125,7 @@ class hdp-mysql::server(
       # Now MySQL is running so we remove the temporary file
       file {'/tmp/addMysqlUser.sh':
         ensure => absent,
-        require => Service[$service_name],
+        require => Exec[$service_name],
         notify => Anchor['hdp-mysql::server::end'],
       }
     }

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server.pp?rev=1465152&r1=1465151&r2=1465152&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server.pp (original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server.pp Fri Apr  5 23:03:15 2013
@@ -227,10 +227,19 @@ class hdp-nagios::server::web_permisssio
 
 class hdp-nagios::server::services($ensure)
 {
-  if ($ensure in ['running','stopped']) {
-    service { 'nagios': ensure => $ensure}
-    anchor{'hdp-nagios::server::services::begin':} ->  Service['nagios'] ->  anchor{'hdp-nagios::server::services::end':}
-  }
+   if ($ensure == 'running') {
+     $command = "service nagios start"
+   } elsif ($ensure == 'stopped') {
+     $command = "service nagios stop"
+   }
+
+   if ($ensure in ['running','stopped']) {
+     exec { "nagios":
+       command => $command,
+       path    => "/usr/local/bin/:/bin/:/sbin/",      
+     }
+     anchor{'hdp-nagios::server::services::begin':} ->  Exec['nagios'] ->  anchor{'hdp-nagios::server::services::end':}	
+   }
 }
 
 class hdp-nagios::server::enable_snmp() {