X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fsrc%2Frebootmgr.c;h=43964bce2343efa6f3dcaa715c3e1380f5e0a458;hb=daa1be889fdaa24ccd3ec683cbe70b446dc9c450;hp=47420b52c128d5f4d065f600daa506117f83c12a;hpb=10d5dfbce0061478737f211188e5c4f7db72b6f8;p=util-vserver.git diff --git a/util-vserver/src/rebootmgr.c b/util-vserver/src/rebootmgr.c index 47420b5..43964bc 100644 --- a/util-vserver/src/rebootmgr.c +++ b/util-vserver/src/rebootmgr.c @@ -37,6 +37,11 @@ The vreboot utility is used to send the signal from the vserver environment. */ +#ifdef HAVE_CONFIG_H +# include +#endif +#include "compat.h" + #include #include #include @@ -61,7 +66,7 @@ static int rebootmgr_opensocket (const char *vname) int ret = -1; char sockn[PATH_MAX]; int fd = socket (AF_UNIX,SOCK_STREAM,0); - sprintf (sockn,"/vservers/%s/dev/reboot",vname); + sprintf (sockn,"%s/%s/dev/reboot",VROOTDIR, vname); unlink (sockn); if (fd == -1){ fprintf (stderr,"Can't create a unix domain socket (%s)\n" @@ -99,13 +104,13 @@ static int rebootmgr_process (int fd, const char *vname) if (strcmp(buf,"reboot\n")==0){ char cmd[1000]; syslog (LOG_NOTICE,"reboot vserver %s\n",vname); - snprintf (cmd,sizeof(cmd)-1,"/usr/sbin/vserver %s restart >>/var/log/boot.log 2>&1",vname); + snprintf (cmd,sizeof(cmd)-1,"%s/vserver %s restart >>/var/log/boot.log 2>&1",SBINDIR, vname); system (cmd); ret = 0; }else if (strcmp(buf,"halt\n")==0){ char cmd[1000]; syslog (LOG_NOTICE,"halt vserver %s\n",vname); - snprintf (cmd,sizeof(cmd)-1,"/usr/sbin/vserver %s stop >>/var/log/boot.log 2>&1",vname); + snprintf (cmd,sizeof(cmd)-1,"%s/vserver %s stop >>/var/log/boot.log 2>&1",SBINDIR, vname); system (cmd); ret = 0; }else{