units: do not fail if imds is not configured
In https://bugzilla.redhat.com/show_bug.cgi?id=2481466, it is reported that systemd-imds-early-network.service fails on AWS EC2 instance with: > No IMDS endpoint information provided or detected, cannot operate. The service will be started on various systems where it doesn't have enough configuration to run. The systemd-imds-generator only does some superficial checks, so the tool should not mark the boot as failed it turns out that IMDS is not supported.
This commit is contained in:
committed by
Yu Watanabe
parent
e329ef572d
commit
0dc188e006
+5
-2
@@ -24,6 +24,7 @@
|
||||
#include "errno-util.h"
|
||||
#include "escape.h"
|
||||
#include "event-util.h"
|
||||
#include "exit-status.h"
|
||||
#include "fd-util.h"
|
||||
#include "format-ifname.h"
|
||||
#include "format-table.h"
|
||||
@@ -63,7 +64,7 @@
|
||||
* https://docs.hetzner.cloud/reference/cloud#description/server-metadata
|
||||
*
|
||||
* Some notes:
|
||||
* - IMDS service are heavily rate limited, and hence we want to centralize requests in one place and cache
|
||||
* - IMDS service are heavily rate-limited, and hence we want to centralize requests in one place and cache
|
||||
* - In order to isolate IMDS access this expects that traffic to the IMDS address 169.254.169.254 is
|
||||
* generally prohibited (via a prohibit route), but our service uses fwmark 0x7FFF0815, which (via source
|
||||
* routing) can bypass this route.
|
||||
@@ -1851,7 +1852,9 @@ static int cmdline_run(void) {
|
||||
|
||||
/* Process the request when invoked via the command line (i.e. not via Varlink) */
|
||||
|
||||
r = imds_configured(LOG_ERR);
|
||||
r = imds_configured(LOG_INFO);
|
||||
if (r == -EOPNOTSUPP)
|
||||
return EXIT_NOTCONFIGURED;
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user