From e7d6ce5978c3486a585b0acb2f759db0e1615e83 Mon Sep 17 00:00:00 2001 From: "David E. Eisenstat" Date: Sun, 20 May 2007 12:45:00 +0000 Subject: [PATCH] Change "slice suspended" and "not been allocated resources" messages to include hostname. --- src/vsh.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/vsh.c b/src/vsh.c index 7e8360e..b80b8d8 100644 --- a/src/vsh.c +++ b/src/vsh.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -198,19 +199,26 @@ static int sandbox_processes(xid_t ctx, char *context) #else int ctx_is_new; struct sliver_resources slr; + char hostname[HOST_NAME_MAX+1]; pl_get_limits(context,&slr); + if (gethostname(hostname, sizeof hostname) == -1) + { + PERROR("gethostname(...)"); + exit(1); + } + /* check whether the slice has been taken off of the whitelist */ if (slr.vs_whitelisted==0) { - fprintf(stderr, "*** %s has not been allocated resources on this node ***\n", context); + fprintf(stderr, "*** %s: %s has not been allocated resources on this node ***\n", hostname, context); exit(0); } /* check whether the slice has been suspended */ if (slr.vs_cpu==0) { - fprintf(stderr, "*** %s has zero cpu resources and presumably it has been disabled/suspended ***\n"); + fprintf(stderr, "*** %s: %s has zero cpu resources and presumably it has been disabled/suspended ***\n", hostname, context); exit(0); } -- 2.43.0