I am attempting to create a new EC2 instance and I am supplying user-data to the instance at create time. My user-data executes some bash commands that modify the parameters of a properties file for another application (myApplication). The intent is to modify the configuration of myApplication BEFORE it starts. myApplication is configured to start from /etc/init.d .
I'm basically trying to do what is described here
I see that the chkconfig configuration for /etc/init.d/cloud-init-local is set with priority 50. I am assuming that this is the mechanism by which my user-data script is executed.
myApplication is also configured with chkconfig, but with priority 90. The plan is that the user-data is executed BEFORE myApplication starts.
But, this is not what I am experiencing. I can see in the cloud-init-output.log file that my user-data does get executed, but myApplication has already started.
Is my assumption that my user-data script is executed by /etc/init.d/cloud-init-local wrong? Is my expectation of the behavior of the boot sequence incorrect?
Any help is appreciated, thanks!