diff options
author | Miklos Vajna <vmiklos@frugalware.org> | 2013-03-24 10:06:38 +0100 |
---|---|---|
committer | Michael Biebl <biebl@debian.org> | 2013-03-24 12:42:41 +0100 |
commit | 3f95f83c548d180cddc6b9907f8d8d72ebd5abe9 (patch) | |
tree | 798b1f343387890b1242eb2c6077a59b7445cf13 /src | |
parent | 7964dfca1b6c4b37d069b3713f9f1b11219c3474 (diff) |
service: no need to drop rc. prefix anymore
This reverts commit f5c88ec1330b61787441156de7d764a140774bd2. It is no
longer necessary, and adds unnecessary magic.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/service.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/core/service.c b/src/core/service.c index 080d583b69..4451d38eef 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -331,9 +331,6 @@ static char *sysv_translate_name(const char *name) { if (endswith(name, ".sh")) /* Drop .sh suffix */ strcpy(stpcpy(r, name) - 3, ".service"); - else if (startswith(name, "rc.")) - /* Drop rc. prefix */ - strcpy(stpcpy(r, name + 3), ".service"); else /* Normal init script name */ strcpy(stpcpy(r, name), ".service"); @@ -984,10 +981,8 @@ static int service_load_sysv_name(Service *s, const char *name) { assert(s); assert(name); - /* For SysV services we strip the rc.* and *.sh - * prefixes/suffixes. */ - if (startswith(name, "rc.") || - endswith(name, ".sh.service")) + /* For SysV services we strip the *.sh suffixes. */ + if (endswith(name, ".sh.service")) return -ENOENT; STRV_FOREACH(p, UNIT(s)->manager->lookup_paths.sysvinit_path) { @@ -1010,19 +1005,6 @@ static int service_load_sysv_name(Service *s, const char *name) { } free(path); - if (r >= 0 && UNIT(s)->load_state == UNIT_STUB) { - /* Try rc.* init scripts */ - - path = strjoin(*p, "/rc.", name, NULL); - if (!path) - return -ENOMEM; - - /* Drop .service suffix */ - path[strlen(path)-8] = 0; - r = service_load_sysv_path(s, path); - free(path); - } - if (r < 0) return r; |