[systemd-devel] Can a systemd --user instance rely on After= of systemd --system instance?

Lennart Poettering lennart at poettering.net
Fri Mar 31 11:17:56 UTC 2017

On Sat, 04.03.17 22:07, Andrei Borzenkov (arvidjaar at gmail.com) wrote:

> 04.03.2017 13:49, Peter Hoeg пишет:
> > Hi,
> > 
> >> If I have a user service which needs to have the system database server
> >> available: How do I construct a proper depend?
> > 
> > As Lennart was pointing out, the user and system instances do not know
> > anything about each other, so you cannot.
> > 
> "You cannot because it is currently unimplemented", "you cannot because
> we do not care but feel free to implement" or "you cannot because we
> will never even consider it"?

Quite frankly, I pretty much opposed to adding that...

Socket activation (as suggested) is the much simplre and more robust
way, since it makes it unnecessary to define explicit deps altogether.

> This means you need to set absurdly large TimeoutStart because you have
> no idea when other service appears, so every time you attempt to start
> service you will need to wait absurdly large time before proceeding with
> error handling. Proper service dependency won't even attempt to start
> dependent service until dependencies are known to run.

This is a misunderstanding how socket activation works.

> systemd already propagates some unit types (devices, mounts and swaps)
> from system to user instance. Are there any fundamental problems that
> prevent doing it for other types?

That's not really the case. All systemd instances track the kernel
state, that's all. The user instance of systemd does not communicate
with the system instance at all really, and I kinda like that.


Lennart Poettering, Red Hat

More information about the systemd-devel mailing list