git://git.onelab.eu
/
util-vserver.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
239223b
)
Change "slice suspended" and "not been allocated resources" messages to include hostname.
author
David E. Eisenstat
<deisenst@cs.princeton.edu>
Sun, 20 May 2007 12:45:00 +0000
(12:45 +0000)
committer
David E. Eisenstat
<deisenst@cs.princeton.edu>
Sun, 20 May 2007 12:45:00 +0000
(12:45 +0000)
src/vsh.c
patch
|
blob
|
history
diff --git
a/src/vsh.c
b/src/vsh.c
index
7e8360e
..
b80b8d8
100644
(file)
--- a/
src/vsh.c
+++ b/
src/vsh.c
@@
-28,6
+28,7
@@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
+#include <limits.h>
#include <pwd.h>
#include <unistd.h>
#include <syscall.h>
#include <pwd.h>
#include <unistd.h>
#include <syscall.h>
@@
-198,19
+199,26
@@
static int sandbox_processes(xid_t ctx, char *context)
#else
int ctx_is_new;
struct sliver_resources slr;
#else
int ctx_is_new;
struct sliver_resources slr;
+ char hostname[HOST_NAME_MAX+1];
pl_get_limits(context,&slr);
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)
{
/* 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)
{
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);
}
exit(0);
}