Categories
Linux Mastering Development

why script bash is killed during ambari-agent stop

I am using the following simple script in order to stop and start the ambari agent on linux machine rhel 7.6

more /tmp/script

#!/bin/bash

ambari-agent start
sleep 10
ambari-agent stop

echo "start stop ambari agent ended"

example

bash script


Verifying Python version compatibility...
Using python  /usr/bin/python
Checking for previously running Ambari Agent...
/run/ambari-agent/ambari-agent.pid found with no process. Removing 25236...
Checking ambari-common dir...
Starting ambari-agent
Verifying ambari-agent process status...
Ambari Agent successfully started
Agent PID at: /run/ambari-agent/ambari-agent.pid
Agent out at: /var/log/ambari-agent/ambari-agent.out
Agent log at: /var/log/ambari-agent/ambari-agent.log
Verifying Python version compatibility...
Using python  /usr/bin/python
Found ambari-agent PID: 25810
Stopping ambari-agent
Killed

as we can see from some unclear reason the script itself is killed when ambari-agent stop performed
and therefore echo "stop start ambari agent ended" , never implemented

any idea why this happens?

Leave an answer

Your email address will not be published. Required fields are marked *