Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue number:
Description of changes:
Previously, hostname was written directly to disk by
netdog
called bywicked
early in boot. At this point in the boot sequence, the API server isn't up yet. Rather than rework the boot sequence and add the ability to netdog to talk to the API, we opted to add a subcommand tonetdog
as a settings generator for the newsettings.network.hostname
setting. The setting is used in a template file, which is an env file for a new systemd unit that callsnetdog set-hostname
. This command is what will write the hostname to disk at/proc/sys/kernel/hostname
.This means that at boot time, if a user has the
hostname
setting in their user data, we will use it, otherwise we will set the hostname, largely using the same logic as was in the program previously. (The only change is that if the DNS reverse lookup fails, we use the IP in the format "ip-x-x-x" as the hostname).netdog
was reworked to useargh
for argument parsing since our custom logic was starting to get unwieldy with the addition of more subcommands with their own arguments.Testing done:
Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.