[systemd-devel] unit been dead before been running

Lennart Poettering lennart at poettering.net
Fri Mar 15 19:18:24 UTC 2019


On Mi, 13.03.19 11:40, aleivag (aleivag at gmail.com) wrote:

> Hi all:
>
> Sorry to bring this up again... here is what i plan to do, i'm just asking
> if this make sense.
>
> (the context is that i start a transient unit, and pass tty fd, and i need
> to know when the unit is dead, so i can close my fds)
> `systemd1.Manager.StartTransientUnit` returns a job in the form of
> `/org/freedesktop/systemd1/job/<job_id>`, so i'm just going to ignore all
> messages that comes with that Job. Because those comes when the unit is
> starting up.. the final `dead` of `failed` message comes with Job
> (0, '/')..

> do that make sense?

Yes, somewhat. I mean, that's basically like waiting for JobRemoved,
as the instant where the Job property goes to (0, '/') is also the
instant where JobRemoved is sent out. Normally, one would wait for
JobRemoved though, not just PropertiesChanged, as the JobRemoved
message contains info if the job actually succeeeded or not.

Lennart

--
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list