+ other->meta.load_state = UNIT_MERGED;
+ other->meta.merged_into = u;
+
+ unit_add_to_cleanup_queue(other);
+
+ return 0;
+}
+
+int unit_merge_by_name(Unit *u, const char *name) {
+ Unit *other;
+
+ assert(u);
+ assert(name);
+
+ if (!(other = manager_get_unit(u->meta.manager, name)))
+ return unit_add_name(u, name);
+
+ return unit_merge(u, other);
+}
+
+Unit* unit_follow_merge(Unit *u) {
+ assert(u);
+
+ while (u->meta.load_state == UNIT_MERGED)
+ assert_se(u = u->meta.merged_into);
+
+ return u;
+}
+
+int unit_add_exec_dependencies(Unit *u, ExecContext *c) {
+ int r;
+
+ assert(u);
+ assert(c);
+
+ if (c->output != EXEC_OUTPUT_KERNEL && c->output != EXEC_OUTPUT_SYSLOG)
+ return 0;
+
+ /* If syslog or kernel logging is requested, make sure our own
+ * logging daemon is run first. */
+
+ if ((r = unit_add_dependency_by_name(u, UNIT_AFTER, SPECIAL_LOGGER_SOCKET)) < 0)
+ return r;
+
+ if (u->meta.manager->running_as != MANAGER_SESSION)
+ if ((r = unit_add_dependency_by_name(u, UNIT_REQUIRES, SPECIAL_LOGGER_SOCKET)) < 0)
+ return r;
+