journalctl: send READY=1
Allow callers to synchronize on the point in time where the journal file watches are fully established, in --follow mode. Tools can invoke journalctl using this, knowing that any log message happening after the READY=1 is definitely going to be processed by the journalctl invocation.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#include "sd-daemon.h"
|
||||
#include "sd-event.h"
|
||||
|
||||
#include "ansi-color.h"
|
||||
@@ -329,6 +330,7 @@ static int on_first_event(sd_event_source *s, void *userdata) {
|
||||
return log_error_errno(r, "Failed to get cursor: %m");
|
||||
}
|
||||
|
||||
(void) sd_notify(/* unset_environment= */ false, "READY=1");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -486,6 +488,8 @@ int action_show(char **matches) {
|
||||
return sig;
|
||||
}
|
||||
|
||||
(void) sd_notify(/* unset_environment= */ false, "READY=1");
|
||||
|
||||
r = show(&c);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
Reference in New Issue
Block a user