From 6faa11140bf776cdaeb8d22d01816e6e48296971 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 30 Mar 2011 02:21:48 +0200 Subject: [PATCH] status: show status messages unconditionally if plymouth is around --- src/main.c | 7 +------ src/unit.c | 5 ++++- src/util.c | 4 ++++ src/util.h | 2 ++ 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/main.c b/src/main.c index 176a4f5e..b43d8eca 100644 --- a/src/main.c +++ b/src/main.c @@ -1093,11 +1093,6 @@ int main(int argc, char *argv[]) { goto finish; } - /* If Plymouth is being run make sure we show the status, so - * that there's something nice to see when people press Esc */ - if (access("/run/initramfs/plymouth", F_OK) >= 0) - arg_show_status = true; - if (arg_action == ACTION_HELP) { retval = help(); goto finish; @@ -1177,7 +1172,7 @@ int main(int argc, char *argv[]) { if (arg_running_as == MANAGER_SYSTEM && !serialization) { locale_setup(); - if (arg_show_status) + if (arg_show_status || plymouth_running()) status_welcome(); kmod_setup(); diff --git a/src/unit.c b/src/unit.c index a2953a6b..b6846492 100644 --- a/src/unit.c +++ b/src/unit.c @@ -2254,7 +2254,10 @@ void unit_status_printf(Unit *u, const char *format, ...) { if (u->meta.manager->running_as != MANAGER_SYSTEM) return; - if (!u->meta.manager->show_status) + /* If Plymouth is running make sure we show the status, so + * that there's something nice to see when people press Esc */ + + if (!u->meta.manager->show_status && !plymouth_running()) return; if (!manager_is_booting_or_shutting_down(u->meta.manager)) diff --git a/src/util.c b/src/util.c index fada69cf..5e101e44 100644 --- a/src/util.c +++ b/src/util.c @@ -4188,6 +4188,10 @@ bool nulstr_contains(const char*nulstr, const char *needle) { return false; } +bool plymouth_running(void) { + return access("/run/initramfs/plymouth", F_OK) >= 0; +} + static const char *const ioprio_class_table[] = { [IOPRIO_CLASS_NONE] = "none", [IOPRIO_CLASS_RT] = "realtime", diff --git a/src/util.h b/src/util.h index 04afc731..dfbfa8b0 100644 --- a/src/util.h +++ b/src/util.h @@ -392,6 +392,8 @@ int kill_and_sigcont(pid_t pid, int sig); bool nulstr_contains(const char*nulstr, const char *needle); +bool plymouth_running(void); + #define NULSTR_FOREACH(i, l) \ for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1) -- 2.39.5