#include <stdlib.h>
#include <string.h>
#include <errno.h>
+#include <limits.h>
#include <pwd.h>
#include <unistd.h>
#include <syscall.h>
#undef CONFIG_VSERVER_LEGACY
+#if 0
/* Base for all vserver roots for chroot */
#define VSERVER_ROOT_BASE "/vservers"
#else
int ctx_is_new;
struct sliver_resources slr;
+ char hostname[HOST_NAME_MAX+1];
pl_get_limits(context,&slr);
- /* check whether the slice has been taken off of the whitelist */
- if (slr.vs_whitelisted==0)
+ if (gethostname(hostname, sizeof hostname) == -1)
{
- fprintf(stderr, "*** %s has not been allocated resources on this node ***\n", context);
- exit(0);
+ PERROR("gethostname(...)");
+ exit(1);
}
/* 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);
}
(void) (sandbox_chroot(ctx));
- if ((ctx_is_new = pl_chcontext(ctx, 0, ~vc_get_insecurebcaps(),&slr)) < 0)
+ if ((ctx_is_new = pl_chcontext(ctx, ~vc_get_insecurebcaps(),&slr)) < 0)
{
PERROR("pl_chcontext(%u)", ctx);
exit(1);
return 0; /* shutup compiler */
}
+#else
+int main(int argc, char *argv[])
+{
+
+ return 0;
+}
+#endif