self.name = name
self.rlimits_changed = False
+ self.cache = None
self.config_file = "/etc/vservers/%s.conf" % name
self.dir = "%s/%s" % (vserverimpl.VSERVER_BASEDIR, name)
if not (os.path.isdir(self.dir) and
os.rename(newfile, filename)
def __do_chroot(self):
-
+ self.cache = True
os.chroot(self.dir)
os.chdir("/")
# execute each init script in turn
# XXX - we don't support all scripts that vserver script does
self.__do_chcontext(state_file)
- for cmd in self.INITSCRIPTS + [None]:
- try:
- # enter vserver context
- arg_subst = { 'runlevel': runlevel }
- cmd_args = [cmd[0]] + map(lambda x: x % arg_subst,
- cmd[1:])
- print >>log, "executing '%s'" % " ".join(cmd_args)
- os.spawnvp(os.P_WAIT,cmd[0],*cmd_args)
- except:
- traceback.print_exc()
- os._exit(1)
+ for cmd in self.INITSCRIPTS + [None]:
+ try:
+ print >>log, cmd
+ # enter vserver context
+ arg_subst = { 'runlevel': runlevel }
+ cmd_args = [cmd[0]] + map(lambda x: x % arg_subst,
+ cmd[1:])
+ print >>log, "executing '%s'" % " ".join(cmd_args)
+ os.spawnvp(os.P_WAIT,cmd[0],cmd_args)
+ except:
+ traceback.print_exc()
+ os._exit(1)
# we get here due to an exception in the top-level child process
except Exception, ex:
pass
def update_resources(self, resources):
-
self.config.update(resources)
-
- # write new values to configuration file
- self.__update_config_file(self.config_file, resources)
+ if not self.cache:
+ # write new values to configuration file
+ self.__update_config_file(self.config_file, resources)
def init_disk_info(self):
%{!?release_func:%global release_func() %1%{?dist}}
%define name util-vserver
-%define version 0.30.208
-%define release 20%{?pldistro:.%{pldistro}}%{?date:.%{date}}
+%define version 0.30.209
+%define release 1%{?pldistro:.%{pldistro}}%{?date:.%{date}}
%define _without_dietlibc 1
%define _without_xalan 1