From: Yu Watanabe Date: Fri, 17 Nov 2023 17:58:50 +0000 (+0900) Subject: journal: sync immediately on shutting down journald X-Git-Tag: v255~96 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3197d778e0d16f7be5f8f887c352c00fe098068d;p=platform%2Fupstream%2Fsystemd.git journal: sync immediately on shutting down journald Otherwise, sd_event_add_time_relative() or sd_event_source_set_time_relative() below will trigger assert_return(). Prompted by #30029. --- diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c index 85def6c..1c3a2a0 100644 --- a/src/journal/journald-server.c +++ b/src/journal/journald-server.c @@ -1877,6 +1877,12 @@ int server_schedule_sync(Server *s, int priority) { return 0; } + if (!s->event || sd_event_get_state(s->event) == SD_EVENT_FINISHED) { + /* Shutting down the server? Let's sync immediately. */ + server_sync(s); + return 0; + } + if (s->sync_scheduled) return 0;