diff --git a/src/basic/locale-util.c b/src/basic/locale-util.c index 7e479d605a7..b2ef66392e1 100644 --- a/src/basic/locale-util.c +++ b/src/basic/locale-util.c @@ -365,6 +365,7 @@ const char *special_glyph(SpecialGlyph code) { [TREE_SPACE] = " ", [TRIANGULAR_BULLET] = ">", [BLACK_CIRCLE] = "*", + [BULLET] = "*", [ARROW] = "->", [MDASH] = "-", [ELLIPSIS] = "...", @@ -381,6 +382,7 @@ const char *special_glyph(SpecialGlyph code) { [TREE_SPACE] = " ", /* */ [TRIANGULAR_BULLET] = "\342\200\243", /* ‣ */ [BLACK_CIRCLE] = "\342\227\217", /* ● */ + [BULLET] = "\342\200\242", /* • */ [ARROW] = "\342\206\222", /* → */ [MDASH] = "\342\200\223", /* – */ [ELLIPSIS] = "\342\200\246", /* … */ diff --git a/src/basic/locale-util.h b/src/basic/locale-util.h index ea624e99082..2aa2bef8c5c 100644 --- a/src/basic/locale-util.h +++ b/src/basic/locale-util.h @@ -45,6 +45,7 @@ typedef enum { TREE_SPACE, TRIANGULAR_BULLET, BLACK_CIRCLE, + BULLET, ARROW, MDASH, ELLIPSIS, diff --git a/src/shared/install.c b/src/shared/install.c index 97c48afe5d8..28e07a23a55 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -1048,11 +1048,14 @@ static int install_info_add( if (r < 0) return r; - i = new0(UnitFileInstallInfo, 1); + i = new(UnitFileInstallInfo, 1); if (!i) return -ENOMEM; - i->type = _UNIT_FILE_TYPE_INVALID; - i->auxiliary = auxiliary; + + *i = (UnitFileInstallInfo) { + .type = _UNIT_FILE_TYPE_INVALID, + .auxiliary = auxiliary, + }; i->name = strdup(name); if (!i->name) { @@ -1749,12 +1752,16 @@ static int install_info_symlink_wants( if (strv_isempty(list)) return 0; - if (unit_name_is_valid(i->name, UNIT_NAME_TEMPLATE) && i->default_instance) { + if (unit_name_is_valid(i->name, UNIT_NAME_TEMPLATE)) { UnitFileInstallInfo instance = { .type = _UNIT_FILE_TYPE_INVALID, }; _cleanup_free_ char *path = NULL; + /* If this is a template, and we have no instance, don't do anything */ + if (!i->default_instance) + return 1; + r = unit_name_replace_instance(i->name, i->default_instance, &buf); if (r < 0) return r; diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index d573f8f17a3..38545e8f5eb 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -6297,18 +6297,19 @@ static int enable_unit(int argc, char *argv[], void *userdata) { } if (carries_install_info == 0 && !ignore_carries_install_info) - log_warning("The unit files have no installation config (WantedBy, RequiredBy, Also, Alias\n" - "settings in the [Install] section, and DefaultInstance for template units).\n" - "This means they are not meant to be enabled using systemctl.\n" - "Possible reasons for having this kind of units are:\n" - "1) A unit may be statically enabled by being symlinked from another unit's\n" - " .wants/ or .requires/ directory.\n" - "2) A unit's purpose may be to act as a helper for some other unit which has\n" - " a requirement dependency on it.\n" - "3) A unit may be started when needed via activation (socket, path, timer,\n" - " D-Bus, udev, scripted systemctl call, ...).\n" - "4) In case of template units, the unit is meant to be enabled with some\n" - " instance name specified."); + log_notice("The unit files have no installation config (WantedBy=, RequiredBy=, Also=,\n" + "Alias= settings in the [Install] section, and DefaultInstance= for template\n" + "units). This means they are not meant to be enabled using systemctl.\n \n" + "Possible reasons for having this kind of units are:\n" + "%1$s A unit may be statically enabled by being symlinked from another unit's\n" + " .wants/ or .requires/ directory.\n" + "%1$s A unit's purpose may be to act as a helper for some other unit which has\n" + " a requirement dependency on it.\n" + "%1$s A unit may be started when needed via activation (socket, path, timer,\n" + " D-Bus, udev, scripted systemctl call, ...).\n" + "%1$s In case of template units, the unit is meant to be enabled with some\n" + " instance name specified.", + special_glyph(BULLET)); if (arg_now && STR_IN_SET(argv[0], "enable", "disable", "mask")) { sd_bus *bus; diff --git a/src/test/test-locale-util.c b/src/test/test-locale-util.c index 6d0f24eeea2..a1d4307eb51 100644 --- a/src/test/test-locale-util.c +++ b/src/test/test-locale-util.c @@ -77,6 +77,7 @@ static void dump_special_glyphs(void) { dump_glyph(TREE_SPACE); dump_glyph(TRIANGULAR_BULLET); dump_glyph(BLACK_CIRCLE); + dump_glyph(BULLET); dump_glyph(ARROW); dump_glyph(MDASH); dump_glyph(ELLIPSIS);