there already exists at least one regular user on the system. If set to "0"
will make the tool skip any such query.
+* `$SYSTEMD_HOME_DRY_RUN` – if set to "1" will make `homectl create` and
+ `homectl update` operate in a "dry-run" mode: the new user record is
+ assembled, and displayed in JSON format, but not actually passed to
+ `systemd-homed` for execution of the operation.
+
`kernel-install`:
* `$KERNEL_INSTALL_BYPASS` – If set to "1", execution of kernel-install is skipped
static bool arg_blob_clear = false;
static Hashmap *arg_blob_files = NULL;
static char *arg_key_name = NULL;
+static bool arg_dry_run = false;
STATIC_DESTRUCTOR_REGISTER(arg_identity_extra, sd_json_variant_unrefp);
STATIC_DESTRUCTOR_REGISTER(arg_identity_extra_this_machine, sd_json_variant_unrefp);
log_warning_errno(r, "Specified password does not pass quality checks (%s), proceeding anyway.", bus_error_message(&error, r));
}
+ if (arg_dry_run) {
+ sd_json_variant_dump(hr->json, SD_JSON_FORMAT_COLOR_AUTO|SD_JSON_FORMAT_PRETTY_AUTO|SD_JSON_FORMAT_NEWLINE, stderr, /* prefix= */ NULL);
+ return 0;
+ }
+
r = acquire_bus(&bus);
if (r < 0)
return r;
if (r < 0)
return r;
+ if (arg_dry_run) {
+ sd_json_variant_dump(hr->json, SD_JSON_FORMAT_COLOR_AUTO|SD_JSON_FORMAT_PRETTY_AUTO|SD_JSON_FORMAT_NEWLINE, stderr, /* prefix= */ NULL);
+ return 0;
+ }
+
/* If we do multiple operations, let's output things more verbosely, since otherwise the repeated
* authentication might be confusing. */
assert(argc >= 0);
assert(argv);
+ /* Eventually we should probably turn this into a proper --dry-run option, but as long as it is not hooked up everywhere let's make it an environment variable only. */
+ r = getenv_bool("SYSTEMD_HOME_DRY_RUN");
+ if (r >= 0)
+ arg_dry_run = r;
+ else if (r != -ENXIO)
+ log_debug_errno(r, "Unable to parse $SYSTEMD_HOME_DRY_RUN, ignoring: %m");
+
for (;;) {
int c;