Commit 38e66114 authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼

Merge branch 'fix-docker-error' into 'develop'

docker changes

See merge request acs/public/villas/VILLAScommon!2
parents 39e23fc9 6f30c7fa
......@@ -253,8 +253,15 @@ int kernel_set_nr_hugepages(int nr)
FILE *f;
f = fopen(PROCFS_PATH "/sys/vm/nr_hugepages", "w");
if (!f)
serror("Failed to open %s", PROCFS_PATH "/sys/vm/nr_hugepages");
if (!f) {
if (access("/.dockerenv", F_OK) != -1) {
warning("This functionality is unavailable in this mode. Please run the Docker container in the privileged mode:");
warning(" $ docker run --privilged ...");
}
else
serror("Failed to open %s", PROCFS_PATH "/sys/vm/nr_hugepages");
}
fprintf(f, "%d\n", nr);
fclose(f);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment