Elemental-register is called without inheriting /etc/profile
variables and settings
#722
Labels
kind/bug
Something isn't working
/etc/profile
variables and settings
#722
What steps did you take and what happened:
It has been noted that
/etc/sysconfig/proxy
is not taken into accound when callingelemental-register
from the cloud-config setup as part of thenetwork.after
yip stage.What did you expect to happen:
The proxy been taken into account for the
elemental-register
call, otherwise the registration just fails and the process is stuck trying to register in the foreground ofcos-setup-network.service
.Anything else you would like to add:
This is happening because
/etc/sysconfig/proxy
is loaded as part of the/etc/profile
which is not being loaded on the shell executing the commands defined innetwork.after
stage.Within the
network.after
I did few trials with the following commands:Only the last one is including the variables and setup defined in
/etc/profile
.Within this experiments I also noted
elemental-register
is executed in the foreground and it does not end until it registers (keeps trying on failures). This is bad, as this means thenetwork.after
stage is stuck with this command and anything after it is not executed. This also meanscos-setup-network
service is stuck in activating state. I realized that because the testing commands I added innetwork.after
iniso-config
where not executed as before those the same stage from/system/oem
is executed and got stuck there. We should be careful to not add blocking commands in yip stages.I believe the solution is to mimic the same approach as with elemental-system-agent. Wrap elemental-register in a unit file (called with
bash --login -c elemental-register ...
) and simply start the service as part of the cloud-init setup. Also we could consider calling elemental-register on every boot and just enable the service by default, but I'd do that on a second interation as this might require some small tweaks in elemental-register code to handle this case appropriately.Environment:
cat /etc/os-release
): Stagingkubectl version
):The text was updated successfully, but these errors were encountered: