<entry>The unit file was generated dynamically via a generator tool. See <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>. Generated unit files may not be enabled, they are enabled implicitly by their generator.</entry>
<entry>0</entry>
</row>
+ <row>
+ <entry><literal>transient</literal></entry>
+ <entry>The unit file has been created dynamically with the runtime API. Transient units may not be enabled.</entry>
+ <entry>0</entry>
+ </row>
<row>
<entry><literal>bad</literal></entry>
<entry>The unit file is invalid or another error occurred. Note that <command>is-enabled</command> will not actually return this state, but print an error message instead. However the unit file listing printed by <command>list-unit-files</command> might show it.</entry>
if (r == -ESHUTDOWN)
return sd_bus_error_setf(error, BUS_ERROR_UNIT_MASKED, "Unit file is masked.");
if (r == -EADDRNOTAVAIL)
- return sd_bus_error_setf(error, BUS_ERROR_UNIT_GENERATED, "Unit file is generated.");
+ return sd_bus_error_setf(error, BUS_ERROR_UNIT_GENERATED, "Unit file is transient or generated.");
if (r < 0)
return r;
if (r == -ESHUTDOWN)
return sd_bus_error_setf(error, BUS_ERROR_UNIT_MASKED, "Unit file is masked.");
if (r == -EADDRNOTAVAIL)
- return sd_bus_error_setf(error, BUS_ERROR_UNIT_GENERATED, "Unit file is generated.");
+ return sd_bus_error_setf(error, BUS_ERROR_UNIT_GENERATED, "Unit file is transient or generated.");
if (r < 0)
return r;
path_equal(p->generator_late, parent);
}
+static int path_is_transient(const LookupPaths *p, const char *path) {
+ _cleanup_free_ char *parent = NULL;
+
+ assert(p);
+ assert(path);
+
+ parent = dirname_malloc(path);
+ if (!parent)
+ return -ENOMEM;
+
+ return path_equal(p->transient, parent);
+}
+
static int path_is_config(const LookupPaths *p, const char *path) {
_cleanup_free_ char *parent = NULL;
const char *rpath;
return -ESHUTDOWN;
if (path_is_generator(&paths, target_info->path))
return -EADDRNOTAVAIL;
+ if (path_is_transient(&paths, target_info->path))
+ return -EADDRNOTAVAIL;
assert(target_info->type == UNIT_FILE_TYPE_REGULAR);
return -ESHUTDOWN;
if (path_is_generator(&paths, i->path))
return -EADDRNOTAVAIL;
+ if (path_is_transient(&paths, i->path))
+ return -EADDRNOTAVAIL;
assert(i->type == UNIT_FILE_TYPE_REGULAR);
return -ESHUTDOWN;
if (path_is_generator(&paths, i->path))
return -EADDRNOTAVAIL;
+ if (path_is_transient(&paths, i->path))
+ return -EADDRNOTAVAIL;
assert(i->type == UNIT_FILE_TYPE_REGULAR);
}
return -ESHUTDOWN;
if (path_is_generator(&paths, i->path))
return -EADDRNOTAVAIL;
+ if (path_is_transient(&paths, i->path))
+ return -EADDRNOTAVAIL;
old_path = skip_root(&paths, i->path);
new_path = strjoina(paths.persistent_config, "/" SPECIAL_DEFAULT_TARGET);
break;
}
+ r = path_is_transient(paths, i->path);
+ if (r < 0)
+ return r;
+ if (r > 0) {
+ state = UNIT_FILE_TRANSIENT;
+ break;
+ }
+
r = find_symlinks_in_scope(scope, paths, i->name, &state);
if (r < 0)
return r;
return -ESHUTDOWN;
if (path_is_generator(paths, i->path))
return -EADDRNOTAVAIL;
+ if (path_is_transient(paths, i->path))
+ return -EADDRNOTAVAIL;
} else
r = install_info_discover(scope, minus, paths, name, SEARCH_FOLLOW_CONFIG_SYMLINKS, &i);
[UNIT_FILE_DISABLED] = "disabled",
[UNIT_FILE_INDIRECT] = "indirect",
[UNIT_FILE_GENERATED] = "generated",
+ [UNIT_FILE_TRANSIENT] = "transient",
[UNIT_FILE_BAD] = "bad",
};
if (r == -ESHUTDOWN)
return log_error_errno(r, "Unit file is masked.");
if (r == -EADDRNOTAVAIL)
- return log_error_errno(r, "Unit file is generated.");
+ return log_error_errno(r, "Unit file is transient or generated.");
if (r < 0)
return log_error_errno(r, "Operation failed: %m");
if (r == -ESHUTDOWN)
return log_error_errno(r, "Unit file is masked.");
if (r == -EADDRNOTAVAIL)
- return log_error_errno(r, "Unit file is generated.");
+ return log_error_errno(r, "Unit file is transient or generated.");
if (r < 0)
return log_error_errno(r, "Can't add dependency: %m");