Lines Matching refs:info
778 const UnitFileInstallInfo *info, in find_symlinks_in_directory() argument
819 found_dest = streq(basename(dest), info->name); in find_symlinks_in_directory()
822 assert(unit_name_is_valid(info->name, UNIT_NAME_ANY)); in find_symlinks_in_directory()
833 found_path = streq(de->d_name, info->name); in find_symlinks_in_directory()
842 found_dest = streq(template, info->name); in find_symlinks_in_directory()
850 t = path_make_absolute(info->name, config_path); in find_symlinks_in_directory()
865 q = is_symlink_with_known_name(info, de->d_name); in find_symlinks_in_directory()
945 const UnitFileInstallInfo *info, in find_symlinks_in_scope() argument
955 assert(info); in find_symlinks_in_scope()
964 … r = find_symlinks(lp->root_dir, info, match_name, ignore_same_name, *p, &same_name_link); in find_symlinks_in_scope()
1004 if (!ignore_same_name && path_startswith(info->path, *p)) in find_symlinks_in_scope()
1017 if (enabled_at_all && unit_name_is_valid(info->name, UNIT_NAME_INSTANCE)) { in find_symlinks_in_scope()
1218 UnitFileInstallInfo *info = ASSERT_PTR(userdata); in config_parse_also() local
1236 r = install_name_printf(ctx->scope, info, word, &printed); in config_parse_also()
1241 r = install_info_add(ctx, printed, NULL, info->root, /* auxiliary= */ true, NULL); in config_parse_also()
1245 r = strv_push(&info->also, printed); in config_parse_also()
1268 UnitFileInstallInfo *info = ASSERT_PTR(userdata); in config_parse_default_instance() local
1285 r = install_name_printf(ctx->scope, info, rvalue, &printed); in config_parse_default_instance()
1297 return free_and_replace(info->default_instance, printed); in config_parse_default_instance()
1302 UnitFileInstallInfo *info, in unit_file_load() argument
1308 … { "Install", "Alias", config_parse_alias, 0, &info->aliases }, in unit_file_load()
1309 … { "Install", "WantedBy", config_parse_strv, 0, &info->wanted_by }, in unit_file_load()
1310 … { "Install", "RequiredBy", config_parse_strv, 0, &info->required_by }, in unit_file_load()
1311 … { "Install", "DefaultInstance", config_parse_default_instance, 0, info }, in unit_file_load()
1322 assert(info); in unit_file_load()
1328 type = unit_name_to_type(info->name); in unit_file_load()
1331 …if (unit_name_is_valid(info->name, UNIT_NAME_TEMPLATE|UNIT_NAME_INSTANCE) && !unit_type_may_templa… in unit_file_load()
1340 info->type = UNIT_FILE_TYPE_MASKED; in unit_file_load()
1342 info->type = UNIT_FILE_TYPE_REGULAR; in unit_file_load()
1372 info->type = UNIT_FILE_TYPE_MASKED; in unit_file_load()
1388 r = config_parse(info->name, path, f, in unit_file_load()
1403 0, info, in unit_file_load()
1406 return log_debug_errno(r, "Failed to parse \"%s\": %m", info->name); in unit_file_load()
1409 info->type = UNIT_FILE_TYPE_REGULAR; in unit_file_load()
1412 (int) strv_length(info->aliases) + in unit_file_load()
1413 (int) strv_length(info->wanted_by) + in unit_file_load()
1414 (int) strv_length(info->required_by); in unit_file_load()
1419 UnitFileInstallInfo *info, in unit_file_load_or_readlink() argument
1425 r = unit_file_load(ctx, info, path, lp->root_dir, flags); in unit_file_load_or_readlink()
1432 true, &info->symlink_target); in unit_file_load_or_readlink()
1437 r = null_or_empty_path_with_root(info->symlink_target, lp->root_dir); in unit_file_load_or_readlink()
1439 return log_debug_errno(r, "Failed to stat %s: %m", info->symlink_target); in unit_file_load_or_readlink()
1441 info->type = UNIT_FILE_TYPE_MASKED; in unit_file_load_or_readlink()
1443 info->type = UNIT_FILE_TYPE_LINKED; in unit_file_load_or_readlink()
1445 info->type = UNIT_FILE_TYPE_ALIAS; in unit_file_load_or_readlink()
1452 UnitFileInstallInfo *info, in unit_file_search() argument
1462 assert(info); in unit_file_search()
1466 if (info->type != _UNIT_FILE_TYPE_INVALID) in unit_file_search()
1469 if (info->path) in unit_file_search()
1470 return unit_file_load_or_readlink(ctx, info, info->path, lp, flags); in unit_file_search()
1472 assert(info->name); in unit_file_search()
1474 if (unit_name_is_valid(info->name, UNIT_NAME_INSTANCE)) { in unit_file_search()
1475 r = unit_name_template(info->name, &template); in unit_file_search()
1483 path = path_join(*p, info->name); in unit_file_search()
1487 r = unit_file_load_or_readlink(ctx, info, path, lp, flags); in unit_file_search()
1489 info->path = TAKE_PTR(path); in unit_file_search()
1510 r = unit_file_load_or_readlink(ctx, info, path, lp, flags); in unit_file_search()
1512 info->path = TAKE_PTR(path); in unit_file_search()
1524 info->name, template ? " or " : "", strempty(template)); in unit_file_search()
1526 if (info->type == UNIT_FILE_TYPE_MASKED) in unit_file_search()
1531 dropin_dir_name = strjoina(info->name, ".d"); in unit_file_search()
1566 r = unit_file_load_or_readlink(ctx, info, *p, lp, flags | SEARCH_DROPIN); in unit_file_search()
1576 UnitFileInstallInfo *info, in install_info_follow() argument
1582 assert(info); in install_info_follow()
1584 if (!IN_SET(info->type, UNIT_FILE_TYPE_ALIAS, UNIT_FILE_TYPE_LINKED)) in install_info_follow()
1586 if (!info->symlink_target) in install_info_follow()
1591 if (!ignore_different_name && !streq(basename(info->symlink_target), info->name)) in install_info_follow()
1594 free_and_replace(info->path, info->symlink_target); in install_info_follow()
1595 info->type = _UNIT_FILE_TYPE_INVALID; in install_info_follow()
1597 return unit_file_load_or_readlink(ctx, info, info->path, lp, flags); in install_info_follow()
1730 UnitFileInstallInfo *info; in install_info_discover() local
1737 r = install_info_add_auto(ctx, lp, name, &info); in install_info_discover()
1739 r = install_info_traverse(ctx, lp, info, flags, ret); in install_info_discover()
1765 const UnitFileInstallInfo *info, in unit_file_verify_alias() argument
1819 r = unit_symlink_name_compatible(path_alias, info->name, instance_propagation); in unit_file_verify_alias()
1823 unit_file_changes_add(changes, n_changes, -EXDEV, dst, info->name); in unit_file_verify_alias()
1826 info->name, dst); in unit_file_verify_alias()
1835 UnitNameFlags type = unit_name_to_instance(info->name, &inst); in unit_file_verify_alias()
1837 … unit_file_changes_add(changes, n_changes, -EUCLEAN, info->name, NULL); in unit_file_verify_alias()
1838 … return log_debug_errno(type, "Failed to extract instance name from \"%s\": %m", info->name); in unit_file_verify_alias()
1849 r = unit_validate_alias_symlink_or_warn(LOG_DEBUG, dst_updated ?: dst, info->name); in unit_file_verify_alias()
1856 info->name); in unit_file_verify_alias()
1867 UnitFileInstallInfo *info, in install_info_symlink_alias() argument
1876 assert(info); in install_info_symlink_alias()
1880 STRV_FOREACH(s, info->aliases) { in install_info_symlink_alias()
1883 q = install_name_printf(scope, info, *s, &dst); in install_info_symlink_alias()
1890 q = unit_file_verify_alias(info, dst, &dst_updated, changes, n_changes); in install_info_symlink_alias()
1902 q = create_symlink(lp, info->path, alias_path, force, changes, n_changes); in install_info_symlink_alias()
1912 UnitFileInstallInfo *info, in install_info_symlink_wants() argument
1925 assert(info); in install_info_symlink_wants()
1932 if (unit_name_is_valid(info->name, UNIT_NAME_PLAIN | UNIT_NAME_INSTANCE)) in install_info_symlink_wants()
1934 n = info->name; in install_info_symlink_wants()
1936 else if (info->default_instance) { in install_info_symlink_wants()
1944 r = unit_name_replace_instance(info->name, info->default_instance, &buf); in install_info_symlink_wants()
1967 n = info->name; in install_info_symlink_wants()
1973 q = install_name_printf(scope, info, *s, &dst); in install_info_symlink_wants()
2005 q = create_symlink(lp, info->path, path, true, changes, n_changes); in install_info_symlink_wants()
2010 … unit_file_changes_add(changes, n_changes, UNIT_FILE_DESTINATION_NOT_PRESENT, dst, info->path); in install_info_symlink_wants()
2017 UnitFileInstallInfo *info, in install_info_symlink_link() argument
2027 assert(info); in install_info_symlink_link()
2030 assert(info->path); in install_info_symlink_link()
2032 r = in_search_path(lp, info->path); in install_info_symlink_link()
2038 path = path_join(config_path, info->name); in install_info_symlink_link()
2042 return create_symlink(lp, info->path, path, force, changes, n_changes); in install_info_symlink_link()
2048 UnitFileInstallInfo *info, in install_info_apply() argument
2056 assert(info); in install_info_apply()
2060 if (info->type != UNIT_FILE_TYPE_REGULAR) in install_info_apply()
2065 r = install_info_symlink_link(info, lp, config_path, force, changes, n_changes); in install_info_apply()
2072 r = install_info_symlink_alias(scope, info, lp, config_path, force, changes, n_changes); in install_info_apply()
2074 …q = install_info_symlink_wants(scope, file_flags, info, lp, config_path, info->wanted_by, ".wants/… in install_info_apply()
2078 …q = install_info_symlink_wants(scope, file_flags, info, lp, config_path, info->required_by, ".requ… in install_info_apply()
2618 UnitFileInstallInfo *info, *target_info; in unit_file_add_dependency() local
2651 &info, changes, n_changes); in unit_file_add_dependency()
2655 assert(info->type == UNIT_FILE_TYPE_REGULAR); in unit_file_add_dependency()
2662 l = &info->wanted_by; in unit_file_add_dependency()
2664 l = &info->required_by; in unit_file_add_dependency()
2686 UnitFileInstallInfo *info; in do_unit_file_enable() local
2691 &info, changes, n_changes); in do_unit_file_enable()
2695 assert(info->type == UNIT_FILE_TYPE_REGULAR); in do_unit_file_enable()
2891 UnitFileInstallInfo *info; in unit_file_set_default() local
2908 r = install_info_discover_and_check(&ctx, &lp, name, 0, &info, changes, n_changes); in unit_file_set_default()
2913 … return create_symlink(&lp, info->path, new_path, flags & UNIT_FILE_FORCE, changes, n_changes); in unit_file_set_default()
2923 UnitFileInstallInfo *info; in unit_file_get_default() local
2936 &info, NULL, NULL); in unit_file_get_default()
2939 r = install_info_may_process(info, &lp, NULL, 0); in unit_file_get_default()
2943 n = strdup(info->name); in unit_file_get_default()
2958 UnitFileInstallInfo *info; in unit_file_lookup_state() local
2969 &info, NULL, NULL); in unit_file_lookup_state()
2973 assert(IN_SET(info->type, UNIT_FILE_TYPE_REGULAR, UNIT_FILE_TYPE_MASKED)); in unit_file_lookup_state()
2974 log_debug("Found unit %s at %s (%s)", name, strna(info->path), in unit_file_lookup_state()
2975 info->type == UNIT_FILE_TYPE_REGULAR ? "regular file" : "mask"); in unit_file_lookup_state()
2981 switch (info->type) { in unit_file_lookup_state()
2984 r = path_is_runtime(lp, info->path, true); in unit_file_lookup_state()
2993 … if (!streq(name, basename(info->path)) && !unit_name_is_valid(info->name, UNIT_NAME_INSTANCE)) { in unit_file_lookup_state()
2998 r = path_is_generator(lp, info->path); in unit_file_lookup_state()
3006 r = path_is_transient(lp, info->path); in unit_file_lookup_state()
3017 r = find_symlinks_in_scope(scope, lp, info, true, &state); in unit_file_lookup_state()
3025 r = find_symlinks_in_scope(scope, lp, info, false, &state); in unit_file_lookup_state()
3031 if (unit_file_install_info_has_rules(info)) in unit_file_lookup_state()
3033 else if (unit_file_install_info_has_also(info)) in unit_file_lookup_state()
3394 UnitFileInstallInfo *info; in preset_prepare_one() local
3401 &info, changes, n_changes); in preset_prepare_one()
3404 if (!streq(name, info->name)) { in preset_prepare_one()
3405 log_debug("Skipping %s because it is an alias for %s.", name, info->name); in preset_prepare_one()
3417 &info, changes, n_changes); in preset_prepare_one()
3423 &info, changes, n_changes); in preset_prepare_one()
3430 &info, changes, n_changes); in preset_prepare_one()