[systemd-devel] Notification when systemd has completed initialisation

Lennart Poettering lennart at poettering.net
Wed Jun 15 07:07:21 PDT 2011


On Wed, 15.06.11 14:28, David.Yates at continental-corporation.com (David.Yates at continental-corporation.com) wrote:

> Hi,
> 
> I was hoping someone could help me to find a way to get a notification of 
> when systemd has finished the initialisation of a specific target.

We currently do not send out an easy-to-user notification for this, but
we probably should.

You can write a client that subscribes to all unit changes, and then
verifies the "Progress" or "FinishTimestampMonotonic" properties of the
manager bus object after each of these messages to see whether to bootup
is complete now. However, this is not very efficient.

I'd be happy to merge a patch that sends out a "Finished" signal or so
when systemd is finished booting. This would be really easy to do
actually, just a small addition to manager_check_finished(). (I have now
added this to the todo list to implement when I find the time to).

Note however that when systemd is finished doing its work this doesn't
necessarily mean that we are really fully booted up. Other services
might still be busy.

> For a specific implementation I am planning, I wanted to be able to have a 
> higher level application that monitors the system startup and analyses the 
> state of the target. As part of this I wanted to get a signal/message from 
> systemd to say when it had completed the systemd startup.
> 
> Does anyone know if this is possible without resorting to polling?

If all you need is a-posteriori performance data you could just query
FinishTimestampMonotonic, StartupTimestampMonotonic,
InitRDTimestampMonotonic which systemd always records on boot.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list