Hi Gonzalo,

Thank you for answers.

The custom action is not just shell command. I need to add custom action to
ambari Service page but for client roles (components).
I know how to do it for Master component, but same function is not beeing
triggered for Client.

Regards,
Andrey

2017-10-05 17:16 GMT+03:00 Gonzalo Herreros <[email protected]>:

> 1) By custom action I guess you mean a shell command, example:
> from resource_management import Execute
> Execute("mkdir /var/lib/mydir")
>
> Typically you would put that in the "install" or "start" method of your
> component script that extends:  from resource_management import Script
>
> 2) AFAIK there is no "uninstall" callback you can implement.
> You could do some cleanup every time you stop the service (assuming it
> doesn't take long to recreate on start) since to delete it you need to stop
> it first.
> Ambari doesn't have a tradition of cleaning up things on deletion
>
> Regards,
> Gonzalo
>
>
> On 5 October 2017 at 14:33, Markovich <[email protected]> wrote:
>
>> Hello ambari users!
>>
>> I've got two questions about implementing custom service.
>> Here they are:
>> 1) How to execute custom action on client host?
>> 2) Is it possible to runs some code on host before deleting the service
>> (for example some cleanup)?
>>
>> Thanks for your time.
>>
>> Regards,
>> Andrey
>>
>
>

Reply via email to