summaryrefslogtreecommitdiff
path: root/src/install.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-06-18 21:33:15 +0200
committerLennart Poettering <lennart@poettering.net>2010-06-18 21:33:15 +0200
commitc32dd69b46c6311148ed666095a13c5e6173c744 (patch)
tree1c1c50dc5c6bfb452b4fd54d3cb6193a03d56a49 /src/install.c
parent4545812fbee75ddbeae7f09cfb461e9b7a93cb84 (diff)
install: make systemd-install useful for installation of template instances
Diffstat (limited to 'src/install.c')
-rw-r--r--src/install.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/install.c b/src/install.c
index 479a38c80a..e30f623627 100644
--- a/src/install.c
+++ b/src/install.c
@@ -181,9 +181,6 @@ static bool unit_name_valid(const char *name) {
/* This is a minimal version of unit_name_valid() from
* unit-name.c */
- if (strchr(name, '/'))
- return false;
-
if (!*name)
return false;
@@ -386,6 +383,9 @@ static int install_info_symlink_alias(InstallInfo *i, const char *config_path) {
if ((r = create_symlink(i->path, alias_path)) != 0)
goto finish;
+
+ if (arg_action == ACTION_DISABLE)
+ rmdir_parents(alias_path, config_path);
}
r = 0;
@@ -422,15 +422,8 @@ static int install_info_symlink_wants(InstallInfo *i, const char *config_path) {
if ((r = create_symlink(i->path, alias_path)) != 0)
goto finish;
- if (arg_action == ACTION_DISABLE) {
- char *t;
-
- /* Try to remove .wants dir if we don't need it anymore */
- if (asprintf(&t, "%s/%s.wants", config_path, *s) >= 0) {
- rmdir(t);
- free(t);
- }
- }
+ if (arg_action == ACTION_DISABLE)
+ rmdir_parents(alias_path, config_path);
}
r = 0;