mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-31 07:51:08 +03:00
service: no need to drop rc. prefix anymore
This reverts commit f5c88ec133
. It is no
longer necessary, and adds unnecessary magic.
This commit is contained in:
parent
7964dfca1b
commit
3f95f83c54
@ -331,9 +331,6 @@ static char *sysv_translate_name(const char *name) {
|
|||||||
if (endswith(name, ".sh"))
|
if (endswith(name, ".sh"))
|
||||||
/* Drop .sh suffix */
|
/* Drop .sh suffix */
|
||||||
strcpy(stpcpy(r, name) - 3, ".service");
|
strcpy(stpcpy(r, name) - 3, ".service");
|
||||||
else if (startswith(name, "rc."))
|
|
||||||
/* Drop rc. prefix */
|
|
||||||
strcpy(stpcpy(r, name + 3), ".service");
|
|
||||||
else
|
else
|
||||||
/* Normal init script name */
|
/* Normal init script name */
|
||||||
strcpy(stpcpy(r, name), ".service");
|
strcpy(stpcpy(r, name), ".service");
|
||||||
@ -984,10 +981,8 @@ static int service_load_sysv_name(Service *s, const char *name) {
|
|||||||
assert(s);
|
assert(s);
|
||||||
assert(name);
|
assert(name);
|
||||||
|
|
||||||
/* For SysV services we strip the rc.* and *.sh
|
/* For SysV services we strip the *.sh suffixes. */
|
||||||
* prefixes/suffixes. */
|
if (endswith(name, ".sh.service"))
|
||||||
if (startswith(name, "rc.") ||
|
|
||||||
endswith(name, ".sh.service"))
|
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
|
||||||
STRV_FOREACH(p, UNIT(s)->manager->lookup_paths.sysvinit_path) {
|
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);
|
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)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user