--- vserver-0.22.orig/rebootmgr.cc
+++ vserver-0.22/rebootmgr.cc
@@ -39,14 +39,29 @@
 {
 	fprintf (stderr,"rebootmgr version %s\n",VERSION);
 	fprintf (stderr,"\n");
-	fprintf (stderr,"rebootmgr [--pidfile file ] vserver-name [ vserver-name ...]\n");
+	fprintf (stderr,"rebootmgr [--pidfile file ] vserver-name [ vserver-name ...]\n\n");
+	fprintf (stderr,"rebootmgr vserver-name [ vserver-name ...]\n\n");
+	fprintf (stderr,"An environment variable VSERVERS_ROOT can change the default directory\n");
+	fprintf (stderr,"/vservers to somewhere else.\n");
 }
 
 static int rebootmgr_opensocket (const char *vname)
 {
 	int ret = -1;
 	char sockn[PATH_MAX];
-	sprintf (sockn,"/vservers/%s/dev/reboot",vname);
+	char* vrootenv = getenv("VSERVERS_ROOT");
+
+	if (vrootenv == NULL) {
+		vrootenv = "/vservers";
+	}
+	if (strlen(vrootenv)+strlen(vname)+strlen("//dev/reboot") > PATH_MAX) {
+		fprintf (stderr,"Environment VSERVERS_ROOT + vservername"
+				"exceeds the maximum path length,"
+				"using default root /vservers.");
+		vrootenv = "/vservers";
+	}
+	sprintf (sockn,"%s/%s/dev/reboot",vrootenv,vname);
+
 	unlink (sockn);
 	int fd =  socket (AF_UNIX,SOCK_STREAM,0);
 	if (fd == -1){
