diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-04-17 20:37:30 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-04-19 09:03:47 -0400 |
commit | fe4aede922f145df8b82108d937b65dcd3443588 (patch) | |
tree | 3a6933e34367d77f5160edeba5c1b408e02c3117 /src/systemctl | |
parent | 1fa0336081a671001a59ea56376132f3ef069a7b (diff) |
systemctl: warning about missing install info for template units
The advice string didn't talk about template units at all. Extend
it and print when trying to enable a template unit without install info.
Fixes #2345.
Diffstat (limited to 'src/systemctl')
-rw-r--r-- | src/systemctl/systemctl.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index cfdc851a6d..115c00ea9c 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -5527,15 +5527,18 @@ static int enable_unit(int argc, char *argv[], void *userdata) { } if (carries_install_info == 0) - log_warning("The unit files have no [Install] section. They are not meant to be enabled\n" - "using systemctl.\n" + 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"); + " 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."); if (arg_now && n_changes > 0 && STR_IN_SET(argv[0], "enable", "disable", "mask")) { char *new_args[n_changes + 2]; |