summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2021-03-31 14:58:11 +0200
committerHans de Goede <hdegoede@redhat.com>2021-04-06 13:15:05 +0200
commita4bb4c146b8461d872136684575ba15c8ab4c8c8 (patch)
tree09e043d607a369ebe6fd812f01863d644b947b11
parenteb5227b47485183174f98807e15d224ecde25217 (diff)
main: Dump debug log to plymouth-shutdown-debug.log on shutdown/reboot
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>
-rw-r--r--src/main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 0cee985e..1c5faa6c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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)