From 51af9fa384c42d3143ac0bb66848bca199b77817 Mon Sep 17 00:00:00 2001 From: Marius Tolzmann Date: Sat, 24 Oct 2015 00:43:14 +0200 Subject: [PATCH] mxqd: Use full memory by default for every job when run as non-root --- mxqd.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mxqd.c b/mxqd.c index eed111a2..3a7fa6a6 100644 --- a/mxqd.c +++ b/mxqd.c @@ -516,6 +516,11 @@ int server_init(struct mxq_server *server, int argc, char *argv[]) } server->memory_total = arg_memory_total; server->memory_max_per_slot = arg_memory_max; + + /* if run as non-root use full memory by default for every job */ + if (!arg_memory_max && getuid() != 0) + server->memory_max_per_slot = arg_memory_total; + server->memory_avg_per_slot = (long double)server->memory_total / (long double)server->slots; if (server->memory_max_per_slot < server->memory_avg_per_slot)