[systemd-commits] 3 commits - src/dbus-manager.c src/locale-setup.c src/main.c src/unit.c src/util.c src/util.h
Lennart Poettering
lennart at kemper.freedesktop.org
Tue Mar 29 17:22:37 PDT 2011
src/dbus-manager.c | 16 +++++++++-------
src/locale-setup.c | 2 +-
src/main.c | 32 ++++++++++++++++++++++----------
src/unit.c | 5 ++++-
src/util.c | 4 ++++
src/util.h | 2 ++
6 files changed, 42 insertions(+), 19 deletions(-)
New commits:
commit 6faa11140bf776cdaeb8d22d01816e6e48296971
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Mar 30 02:21:48 2011 +0200
status: show status messages unconditionally if plymouth is around
diff --git a/src/main.c b/src/main.c
index 176a4f5..b43d8ec 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 a2953a6..b684649 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 fada69c..5e101e4 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 04afc73..dfbfa8b 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)
commit 871c44a747a8bf4465cbfda445216e9ac66d4a40
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Mar 30 02:12:46 2011 +0200
taint: add missing cgroups taint flag
diff --git a/src/dbus-manager.c b/src/dbus-manager.c
index a2a25b7..92a6022 100644
--- a/src/dbus-manager.c
+++ b/src/dbus-manager.c
@@ -20,6 +20,7 @@
***/
#include <errno.h>
+#include <unistd.h>
#include "dbus.h"
#include "log.h"
@@ -224,16 +225,17 @@ static int bus_manager_append_tainted(Manager *m, DBusMessageIter *i, const char
assert(property);
if (m->taint_usr)
- e = stpcpy(e, "usr-separate-fs");
+ e = stpcpy(e, "usr-separate-fs ");
- if (readlink_malloc("/etc/mtab", &p) < 0) {
- if (e != buf)
- e = stpcpy(e, " ");
- e = stpcpy(e, "etc-mtab-not-symlink");
- } else
+ if (readlink_malloc("/etc/mtab", &p) < 0)
+ e = stpcpy(e, "etc-mtab-not-symlink ");
+ else
free(p);
- t = buf;
+ if (access("/proc/cgroups", F_OK) < 0)
+ e = stpcpy(e, "cgroups-missing ");
+
+ t = strstrip(buf);
if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &t))
return -ENOMEM;
diff --git a/src/main.c b/src/main.c
index 8d27eb4..176a4f5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -985,10 +985,26 @@ static void test_usr(void) {
/* Check that /usr is not a separate fs */
- if (dir_is_empty("/usr") > 0)
- log_warning("/usr appears to be on a different file system than /. This is not supported anymore. "
- "Some things will probably break (sometimes even silently) in mysterious ways. "
- "Consult http://freedesktop.org/wiki/Software/systemd/separate-usr-is-broken for more information.");
+ if (dir_is_empty("/usr") <= 0)
+ return;
+
+ log_warning("/usr appears to be on a different file system than /. This is not supported anymore. "
+ "Some things will probably break (sometimes even silently) in mysterious ways. "
+ "Consult http://freedesktop.org/wiki/Software/systemd/separate-usr-is-broken for more information.");
+}
+
+static void test_cgroups(void) {
+
+ if (access("/proc/cgroups", F_OK) >= 0)
+ return;
+
+ log_warning("CONFIG_CGROUPS was not set when your kernel was compiled. "
+ "Systems without control groups are not supported. "
+ "We will now sleep for 10s, and then continue boot-up. "
+ "Expect breakage and please do not file bugs. "
+ "Instead fix your kernel and enable CONFIG_CGROUPS." );
+
+ sleep(10);
}
int main(int argc, char *argv[]) {
@@ -1171,6 +1187,7 @@ int main(int argc, char *argv[]) {
test_mtab();
test_usr();
+ test_cgroups();
}
if ((r = manager_new(arg_running_as, &m)) < 0) {
commit d885ac661b74bb44691c4ac16822e93cf08e11e9
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Mar 30 02:09:15 2011 +0200
locale: don't access misinitialized variable
diff --git a/src/locale-setup.c b/src/locale-setup.c
index e146746..39b877c 100644
--- a/src/locale-setup.c
+++ b/src/locale-setup.c
@@ -65,7 +65,7 @@ static const char * const variable_names[_VARIABLE_MAX] = {
int locale_setup(void) {
char *variables[_VARIABLE_MAX];
- int r, i;
+ int r = 0, i;
zero(variables);
More information about the systemd-commits
mailing list