service: don't create sysv order deps on merged units
This commit is contained in:
parent
6ccb1b4429
commit
9f151f29fd
|
@ -239,9 +239,9 @@ static char *sysv_translate_name(const char *name) {
|
||||||
/* Drop Debian-style .sh suffix */
|
/* Drop Debian-style .sh suffix */
|
||||||
strcpy(stpcpy(r, name) - 3, ".service");
|
strcpy(stpcpy(r, name) - 3, ".service");
|
||||||
#ifdef TARGET_ARCH
|
#ifdef TARGET_ARCH
|
||||||
else if (startswith(name, "@"))
|
else if (startswith(name, "@"))
|
||||||
/* Drop Arch-style background prefix */
|
/* Drop Arch-style background prefix */
|
||||||
strcpy(stpcpy(r, name + 1), ".service");
|
strcpy(stpcpy(r, name + 1), ".service");
|
||||||
#endif
|
#endif
|
||||||
else
|
else
|
||||||
/* Normal init scripts */
|
/* Normal init scripts */
|
||||||
|
@ -326,6 +326,9 @@ static int sysv_fix_order(Service *s) {
|
||||||
if (s == t)
|
if (s == t)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (t->meta.load_state != UNIT_LOADED)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (t->sysv_start_priority < 0)
|
if (t->sysv_start_priority < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -578,7 +578,7 @@ const char *unit_description(Unit *u) {
|
||||||
if (u->meta.description)
|
if (u->meta.description)
|
||||||
return u->meta.description;
|
return u->meta.description;
|
||||||
|
|
||||||
return u->meta.id;
|
return strna(u->meta.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void unit_dump(Unit *u, FILE *f, const char *prefix) {
|
void unit_dump(Unit *u, FILE *f, const char *prefix) {
|
||||||
|
@ -1403,6 +1403,9 @@ int unit_add_dependency(Unit *u, UnitDependency d, Unit *other, bool add_referen
|
||||||
assert(d >= 0 && d < _UNIT_DEPENDENCY_MAX);
|
assert(d >= 0 && d < _UNIT_DEPENDENCY_MAX);
|
||||||
assert(other);
|
assert(other);
|
||||||
|
|
||||||
|
u = unit_follow_merge(u);
|
||||||
|
other = unit_follow_merge(other);
|
||||||
|
|
||||||
/* We won't allow dependencies on ourselves. We will not
|
/* We won't allow dependencies on ourselves. We will not
|
||||||
* consider them an error however. */
|
* consider them an error however. */
|
||||||
if (u == other)
|
if (u == other)
|
||||||
|
|
Loading…
Reference in New Issue