From: Lennart Poettering Date: Wed, 30 Mar 2011 00:21:48 +0000 (+0200) Subject: status: show status messages unconditionally if plymouth is around X-Git-Tag: v21~1 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=6faa11140bf776cdaeb8d22d01816e6e48296971;p=elogind.git status: show status messages unconditionally if plymouth is around --- diff --git a/src/main.c b/src/main.c index 176a4f5ec..b43d8eca9 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 a2953a6bc..b68464922 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 fada69cf1..5e101e441 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 04afc731e..dfbfa8b04 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)