@@ -1,5 +1,5 @@
#!/usr/bin/env bash
-# chkconfig: 345 20 80
+# chkconfig: 345 95 20
# description: ambari-agent daemon
# processname: ambari-agent
@@ -13,6 +13,11 @@
# See the License for the specific language governing permissions and
# limitations under the License
+if [ "$1" -eq 1 ]; # Action is install
+then
+ chkconfig --add ambari-agent
+fi
+
if [ "$1" -eq 2 ]; # Action is upgrade
then
if [ -d "/etc/ambari-agent/conf.save" ]
@@ -25,6 +25,8 @@ then
mv /etc/ambari-agent/conf.save /etc/ambari-agent/conf_$(date '+%d_%m_%y_%H_%M').save
fi
mv /etc/ambari-agent/conf /etc/ambari-agent/conf.save
+ chkconfig --del ambari-agent
exit 0
# description: ambari-server daemon
# processname: ambari-server
@@ -21,4 +21,9 @@ fi
ln -s /usr/sbin/ambari-server /etc/init.d/ambari-server
+ chkconfig --add ambari-server
@@ -32,6 +32,9 @@ then
mv /etc/ambari-server/conf /etc/ambari-server/conf.save
+ chkconfig --del ambari-server