]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
main: Dump debug log to plymouth-shutdown-debug.log on shutdown/reboot
authorHans de Goede <hdegoede@redhat.com>
Wed, 31 Mar 2021 12:58:11 +0000 (14:58 +0200)
committerHans de Goede <hdegoede@redhat.com>
Tue, 6 Apr 2021 11:15:05 +0000 (13:15 +0200)
When working on plymouth I always have "plymouth.debug=stream:/dev/null"
on the kernel commandline. This enables tracing without logging anything
to the console and causes the entire trace to be logged to
/var/log/plymouth-debug.log when plymouth quits.

This is very useful for debugging (non crash) issues with plymouth at boot.
With the recent "main: Cleanly quit on SIGTERM" change plymouth will now
also write a trace log to /var/log/plymouth-debug.log on shutdown/reboot,
but this will be overwritten again on boot by the boot log.

This commit changes the default debug_buffer_path value from:
/var/log/plymouth-debug.log to /var/log/plymouth-shutdown-debug.log
when in shutdown or reboot mode so that it does not get overwritten
by the debug-log written at boot.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
src/main.c

index 0cee985ef53bc33b42aef6c69879055437100dc7..1c5faa6c83ca4dd6f1818615d6238b5692daed4e 100644 (file)
@@ -1875,8 +1875,13 @@ check_verbosity (state_t *state)
         }
 
         if (debug_buffer != NULL) {
-                if (debug_buffer_path == NULL)
-                        debug_buffer_path = strdup (PLYMOUTH_LOG_DIRECTORY "/plymouth-debug.log");
+                if (debug_buffer_path == NULL) {
+                        if (state->mode == PLY_BOOT_SPLASH_MODE_SHUTDOWN ||
+                            state->mode == PLY_BOOT_SPLASH_MODE_REBOOT)
+                                debug_buffer_path = strdup (PLYMOUTH_LOG_DIRECTORY "/plymouth-shutdown-debug.log");
+                        else
+                                debug_buffer_path = strdup (PLYMOUTH_LOG_DIRECTORY "/plymouth-debug.log");
+                }
 
                 ply_logger_add_filter (ply_logger_get_error_default (),
                                        (ply_logger_filter_handler_t)