From 961b0bc69cfdc69db7b54374fe6ea48cae6498fb Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 26 Jun 2018 09:15:25 +0200 Subject: [PATCH 1/2] main: Fix getting detailed logs from systemd This are 2 issues with the detailed logs handling: 1) plymouth attaches to the session directly on a show-splash command (in on_show_splash()), but it does not tell systemd to start logging details until the splash is actually shown after the splash_delay. 2) If the splash is actually shown during the initrd (e.g. a diskcript password is necessary) then we tell the initrd systemd instance to log details, but we don't tell the regular initrd instance which takes over as pid 1 after the switch-root to log details. This leads to rather inconsistent logging behavior, e.g.: * If a diskcrypt password is asked for, we only log details from the initrd phase. * If the boot is shorter then splash_delay no details are logged * If the user presses ESC during boot during the initrd, only initrd messages are logged * If the user presses ESC during boot after the initrd, only normal messages are logged This commit fixes both these issues by: 1) Telling systemd to log details as soon as we have attached to the session 2) Telling systemd to log details after the rootfs has been remounted rw Signed-off-by: Hans de Goede --- src/main.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main.c b/src/main.c index 252621d..7655c4f 100644 --- a/src/main.c +++ b/src/main.c @@ -855,6 +855,11 @@ on_system_initialized (state_t *state) ply_trace ("system now initialized, opening log"); state->system_initialized = true; +#ifdef PLY_ENABLE_SYSTEMD_INTEGRATION + if (state->is_attached) + tell_systemd_to_print_details (state); +#endif + prepare_logging (state); } @@ -1774,11 +1779,6 @@ show_theme (state_t *state, return NULL; } -#ifdef PLY_ENABLE_SYSTEMD_INTEGRATION - if (state->is_attached) - tell_systemd_to_print_details (state); -#endif - ply_device_manager_activate_keyboards (state->device_manager); return splash; @@ -1825,6 +1825,10 @@ attach_to_running_session (state_t *state) return false; } +#ifdef PLY_ENABLE_SYSTEMD_INTEGRATION + tell_systemd_to_print_details (state); +#endif + state->is_redirected = should_be_redirected; state->is_attached = true; state->session = session; -- 2.17.1