mirror of
https://github.com/systemd/systemd.git
synced 2024-11-07 01:27:11 +03:00
taint: add missing cgroups taint flag
This commit is contained in:
parent
d885ac661b
commit
871c44a747
@ -20,6 +20,7 @@
|
|||||||
***/
|
***/
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "dbus.h"
|
#include "dbus.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
@ -224,16 +225,17 @@ static int bus_manager_append_tainted(Manager *m, DBusMessageIter *i, const char
|
|||||||
assert(property);
|
assert(property);
|
||||||
|
|
||||||
if (m->taint_usr)
|
if (m->taint_usr)
|
||||||
e = stpcpy(e, "usr-separate-fs");
|
e = stpcpy(e, "usr-separate-fs ");
|
||||||
|
|
||||||
if (readlink_malloc("/etc/mtab", &p) < 0) {
|
if (readlink_malloc("/etc/mtab", &p) < 0)
|
||||||
if (e != buf)
|
e = stpcpy(e, "etc-mtab-not-symlink ");
|
||||||
e = stpcpy(e, " ");
|
else
|
||||||
e = stpcpy(e, "etc-mtab-not-symlink");
|
|
||||||
} else
|
|
||||||
free(p);
|
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))
|
if (!dbus_message_iter_append_basic(i, DBUS_TYPE_STRING, &t))
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
25
src/main.c
25
src/main.c
@ -985,10 +985,26 @@ static void test_usr(void) {
|
|||||||
|
|
||||||
/* Check that /usr is not a separate fs */
|
/* Check that /usr is not a separate fs */
|
||||||
|
|
||||||
if (dir_is_empty("/usr") > 0)
|
if (dir_is_empty("/usr") <= 0)
|
||||||
log_warning("/usr appears to be on a different file system than /. This is not supported anymore. "
|
return;
|
||||||
"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.");
|
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[]) {
|
int main(int argc, char *argv[]) {
|
||||||
@ -1171,6 +1187,7 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
test_mtab();
|
test_mtab();
|
||||||
test_usr();
|
test_usr();
|
||||||
|
test_cgroups();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((r = manager_new(arg_running_as, &m)) < 0) {
|
if ((r = manager_new(arg_running_as, &m)) < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user