diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 00408c4b84..4c520b8669 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -1745,9 +1745,8 @@ int config_parse_trigger_unit( log_syntax(unit, LOG_ERR, filename, line, 0, "Unit type not valid, ignoring: %s", rvalue); return 0; } - - if (type == u->type) { - log_syntax(unit, LOG_ERR, filename, line, 0, "Trigger cannot be of same type, ignoring: %s", rvalue); + if (unit_has_name(u, p)) { + log_syntax(unit, LOG_ERR, filename, line, 0, "Units cannot trigger themselves, ignoring: %s", rvalue); return 0; }