bstopp/puppet-aem

Wait for AEM to start/stop

Closed this issue · 2 comments

Hello Guys,
I hope this finds you well.

This is a version of init.erb that waits for AEM to start or stop.
This is helpful when other things should be done automatically when AEM is up or down.

init.erb.txt

Would be helpful to have that in your module.
Best regards,
Stefan

Grepping in a log is not the best way to detect this. I'm also not sure if this is needed for the start, I think it's suitable to just return when the process has been bootstrapped. The logline you are grepping for is not a guarantee that AEM is fully up and running, it could be that a SP is installing and reboots are occuring for example.
For the shutdown I think it's a good idea to check if the service is shut down completely by polling the pid.
Thanks for the suggestion but if you like to contribute it would ofcourse be better to create a PR instead of dropping in text files ;)

I agree with @bdhoine - Log monitor is the wrong way to make sure that the system is online.

I will also go so far as to say - the existence of the pidfile is all that the init system should care about that the AEM is online. (I believe that init ensures the service is offline when the referenced pid in the pidfile is no longer active, achieving the other point)

If AEM needs to be validated to be online prior to other Puppet activities - we need a mechanism to check for that and it should be:

  1. All bundles active (Dumb and not necessarily valid but simple to implement)
  2. [Configurable] API call to validate bundle state (available OOTB but assumptions must be made)
  3. Custom - user provided bundle/service API call with pre-defined response to indicate AEM is running (Most complex, but most flexible)

I'd be open to any PRs/issues that support these approaches.