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 >
