When the cgroup is not mounted, we silently exit without giving
some clues to the user with what is happening.
Give some info and an explicit error.
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
struct mntent *mntent;
FILE *file = NULL;
int err = -1;
+ int found = 0;
file = setmntent(MTAB, "r");
if (!file) {
if (!strcmp(mntent->mnt_type, "cgroup")) {
- INFO("found cgroup mounted at '%s'", mntent->mnt_dir);
+ INFO("[%d] found cgroup mounted at '%s',opts='%s'",
+ ++found, mntent->mnt_dir, mntent->mnt_opts);
+
err = lxc_one_cgroup_create(name, mntent, pid);
if (err)
goto out;
}
};
+ if (!found)
+ ERROR("No cgroup mounted on the system");
+
out:
endmntent(file);
return err;