I have a Pid 1 problem. Ok so in order to explain i need to focus on my formulation of the problem.
I have a service which is depended on a hostid and a license file generated to match the hostid in order to run. How the hostid is genereted is unknown to me. If the service does not have a valid license the prosess shuts down. So im unable to containerize just this simple service.
But what if I a have another process running first, like an API to set the license file, and to query for hostid. Then this api can set the license file in place. But now to the tricky part, how can I switch the process running PID 1? Cause the service needs to be run as PID 1.
I was thinking of abbreviating with the PID 1 beeing a bash loop which first starts the API, then when the API exits starts the service.
Would this be possible?
And how would you create the bash loop?