On some of the computational AWS instances, the HTTP service at
169.254* does not support HTTP/1.0 keep-alive. This causes the
second part of the user-data not to be transferred and results
in an error during the execution of ucd-aws. Subsequently, the
SSH key never gets provisioned by `ucd`. The result is an unusable
AWS instance that can't be remotely logged into.
Instead, we just terminate and reconnect for the second HTTP
request, reusing some memory where we can. This is a minute
bit slower, and doesn't really come at a size penalty either,
since it's just the same functions being used.
Since we have another task also run `usermod` as well, these
might bump into a lock file for /etc/ files and fail, leaving
the system unable to login a normal user.
This adds support for parsing openstack meta-data.json files in
config-2 filesystems and extracting and installing any SSH pubkeys
into the default user account.
In order to properly parse a config-2 json blob outside of the normal
openstack early initialization, we need to fill the parser table
properly and clean it up.
This exposes some flaws in other parts of this code that appear that
this wasn't entirely fully tested. I have not yet confirmed that
in a config-2 scenario everything actually automatically works yet,
this remains to be done.
The ucd-aws program fetches the user-data for an AMI instance
over http from 169.254.169.254, and passes it back to ucd.
The service is not supposed to be enabled unless you are running
on AWS, as it is highly specific to that cloud.
Prior to this change, a NULL pw_dir would result in pwd_buf being leaked after
write_ssh_keys is called. Granted, it's a minor leak, and only potential, but
should still be fixed regardless.
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
This will ensure that more compilation issues will be detected in future
development, ensuring a clean codebase.
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
- Markup format
- Covers 3 typical use cases
- Hands-on approach explaining the basic configuration steps
and shows exact content of files needed to be created.
Prior to this change, a NULL pw_dir would result in pwd_buf being leaked after
write_ssh_keys is called. Granted, it's a minor leak, and only potential, but
should still be fixed regardless.
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
This will ensure that more compilation issues will be detected in future
development, ensuring a clean codebase.
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
* Make -Werror a compile time option
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
* Ensure test suite builds with -Wl,--as-needed
The linking order is highly important to libtool. Previously we would link
the COMMON_LDADD libraries to the binaries, however no symbols were used so
binutils linker wouldn't link the libraries involved. Next we would link
libtest.la, a static convenience library, and fail at dynamic linking due
to the symbols only being used in this later-added libraries.
The solution is to first link the convenience library, and then link to the
shared libraries, in order for -Wl,--as-needed behaviour to function correctly
and only link the absolutely required libraries.
Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>