diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-06-17 01:22:55 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-06-17 02:43:44 +0200 |
commit | 0a327d753f992ffdcff5f38c861c90bfa1f5a4af (patch) | |
tree | 173653b0fcafcd4df6423960037a383ab8fb69e1 /src/shared/install.c | |
parent | 1713703c966d85de2591498b45b6c035d04350aa (diff) |
install: "systemctl enable" should be a nop for template units lacking a DefaultInstance= setting
Diffstat (limited to 'src/shared/install.c')
-rw-r--r-- | src/shared/install.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/shared/install.c b/src/shared/install.c index 26dbbb6f07..39f5dd2d2d 100644 --- a/src/shared/install.c +++ b/src/shared/install.c @@ -1302,7 +1302,14 @@ static int install_info_symlink_wants( assert(i); assert(config_path); - if (unit_name_is_template(i->name) && i->default_instance) { + if (unit_name_is_template(i->name)) { + + /* Don't install any symlink if there's no default + * instance configured */ + + if (!i->default_instance) + return 0; + buf = unit_name_replace_instance(i->name, i->default_instance); if (!buf) return -ENOMEM; |