Ver código fonte

AMBARI-4058. ambari-agent/server should start automatically upon reboot.

Sumit Mohanty 11 anos atrás
pai
commit
abb68972ef

+ 1 - 1
ambari-agent/etc/init.d/ambari-agent

@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
 #!/usr/bin/env bash
-# chkconfig: 345 20 80
+# chkconfig: 345 95 20
 # description: ambari-agent daemon
 # description: ambari-agent daemon
 # processname: ambari-agent
 # processname: ambari-agent
 
 

+ 5 - 0
ambari-agent/src/main/package/rpm/postinstall.sh

@@ -13,6 +13,11 @@
 # See the License for the specific language governing permissions and
 # See the License for the specific language governing permissions and
 # limitations under the License
 # limitations under the License
 
 
+if [ "$1" -eq 1 ]; # Action is install
+then
+  chkconfig --add ambari-agent
+fi
+
 if [ "$1" -eq 2 ]; # Action is upgrade
 if [ "$1" -eq 2 ]; # Action is upgrade
 then
 then
   if [ -d "/etc/ambari-agent/conf.save" ]
   if [ -d "/etc/ambari-agent/conf.save" ]

+ 2 - 0
ambari-agent/src/main/package/rpm/preremove.sh

@@ -25,6 +25,8 @@ then
         mv /etc/ambari-agent/conf.save /etc/ambari-agent/conf_$(date '+%d_%m_%y_%H_%M').save
         mv /etc/ambari-agent/conf.save /etc/ambari-agent/conf_$(date '+%d_%m_%y_%H_%M').save
     fi
     fi
     mv /etc/ambari-agent/conf /etc/ambari-agent/conf.save
     mv /etc/ambari-agent/conf /etc/ambari-agent/conf.save
+
+    chkconfig --del ambari-agent
 fi
 fi
 
 
 exit 0
 exit 0

+ 1 - 1
ambari-server/sbin/ambari-server

@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
 #!/usr/bin/env bash
-# chkconfig: 345 20 80
+# chkconfig: 345 95 20
 # description: ambari-server daemon
 # description: ambari-server daemon
 # processname: ambari-server
 # processname: ambari-server
 
 

+ 5 - 0
ambari-server/src/main/package/rpm/postinstall.sh

@@ -21,4 +21,9 @@ fi
 
 
 ln -s /usr/sbin/ambari-server /etc/init.d/ambari-server
 ln -s /usr/sbin/ambari-server /etc/init.d/ambari-server
 
 
+if [ "$1" -eq 1 ]; # Action is install
+then
+  chkconfig --add ambari-server
+fi
+
 exit 0
 exit 0

+ 3 - 0
ambari-server/src/main/package/rpm/preremove.sh

@@ -32,6 +32,9 @@ then
     fi
     fi
 
 
     mv /etc/ambari-server/conf /etc/ambari-server/conf.save
     mv /etc/ambari-server/conf /etc/ambari-server/conf.save
+
+    chkconfig --del ambari-server
+
 fi
 fi
 
 
 exit 0
 exit 0