ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim To <>
Subject Re: custom services / status
Date Thu, 04 Jun 2015 00:24:19 GMT
Hi Donald,
If you are setting up a custom service then it depends on what service you
are setting up and whether that process/app already creates the pid file
for you. If not, the following shell command after launching a process will
put the pid in a file of your choosing:

jobs -p | tail -1 > "fully qualified file name containing the pid"

you can then give this filename to the     check_process_status() method
inside your python service script for ambari to check up on the process.
All that Ambari will do inside  check_process_status() is do a kill 0 on
the pid periodically to check if it is running - pretty straightforward.

Hope that helps,

On Wed, Jun 3, 2015 at 5:08 PM, Donald Hansen <>

> Thanks for the quick reply. I was looking at some examples and was curios
> about the pid file. Do I need to create that myself or is there some code
> that is creating that for me automatically?
> On Wednesday, June 3, 2015, Yusaku Sako <> wrote:
>>  Have you implemented the "status" command for the component(s) in your
>> custom service?
>> For most components, the status is based on the PID file.
>> You can look at some examples in the common-services directory:
>>  Yusaku
>>   From: Donald Hansen <>
>> Reply-To: "" <>
>> Date: Wednesday, June 3, 2015 3:39 PM
>> To: "" <>
>> Subject: custom services / status
>>   I'm trying to create a custom service in Ambari and curious how it
>> tells Ambari if the service successfully started or not. I was able to add
>> a python function that starts my service and my service does start
>> correctly but Ambari still shows the service as not started.
>>  Thanks.
>> Donald

*Tim To*
Software Engineer
*PHEMI Health Systems*
180-887 Great Northern Way
Vancouver, BC V5T 4T5
website <> twitter <>

View raw message