To reiterate your requirement you need to do some custom actions when Liferay server is started, so from what I understand you need a startup custom action hook.
This is nothing but a simple hook where you would override some porperties from portal.properties
and provide a custom action class like MyCustomStartupAction
or MyCustomGlobalAction
in that property and implement it.
In the user-guide here is a list of some properties you can configure: Startup Events
This SO Answer gives more information about creating a hook with such properties.