NOTE.
I'm leaving vsliver_vs.py untouched
However, in set_resources, most of the calls to the lower level (vserver/vserverimpl)
methods are called unprotected by a try/except
If any of this fails, then the exception gets caught in accounts:_run only
and this might prevent correct operations
to make things worse, in such a case the error messages printed by vserverimpl
might get lost in daemon mode
So a cleanup in this area might be most useful
def configure(self, rec):
"""Write <rec['keys']> to my authorized_keys file."""
def configure(self, rec):
"""Write <rec['keys']> to my authorized_keys file."""
- logger.verbose('in accounts:configure')
+ logger.verbose('in accounts:configure for %s'%self.name)
new_keys = rec['keys']
if new_keys != self.keys:
self.keys = new_keys
new_keys = rec['keys']
if new_keys != self.keys:
self.keys = new_keys
LOG_LEVEL=1
def set_level(level):
LOG_LEVEL=1
def set_level(level):
assert level in [LOG_NONE,LOG_NODE,LOG_VERBOSE]
LOG_LEVEL=level
assert level in [LOG_NONE,LOG_NODE,LOG_VERBOSE]
LOG_LEVEL=level
import pprint, time
try:
f=open(LOG_SLIVERS,'w')
import pprint, time
try:
f=open(LOG_SLIVERS,'w')
- now=time.strftime("GetSlivers stored at %H:%M:%S", time.localtime())
+ now=time.strftime("GetSlivers stored on %Y.%m.%d at %H:%M:%S", time.localtime())
f.write(now+'\n')
pp=pprint.PrettyPrinter(stream=f,indent=2)
pp.pprint(data)
f.write(now+'\n')
pp=pprint.PrettyPrinter(stream=f,indent=2)
pp.pprint(data)
nm=${NM-"python /usr/share/NodeManager/nm.py"}
prog="Node Manager"
nm=${NM-"python /usr/share/NodeManager/nm.py"}
prog="Node Manager"
+options=${OPTIONS-"-d -s"}
+restartoptions=${RESTARTOPTIONS-"-d"}
pidfile=${PIDFILE-/var/run/nm.pid}
lockfile=${LOCKFILE-/var/lock/subsys/nm}
RETVAL=0
pidfile=${PIDFILE-/var/run/nm.pid}
lockfile=${LOCKFILE-/var/lock/subsys/nm}
RETVAL=0
- do_start ${OPTIONS-"-d -s"}
- do_start ${OPTIONS-"-d"}
+ do_start $restartoptions
os.umask(0)
devnull = os.open(os.devnull, os.O_RDWR)
os.dup2(devnull, 0)
os.umask(0)
devnull = os.open(os.devnull, os.O_RDWR)
os.dup2(devnull, 0)
- crashlog = os.open('/root/nm.stderr', os.O_RDWR | os.O_APPEND | os.O_CREAT, 0644)
+ # xxx fixme - this is just to make sure that nothing gets stupidly lost - should use devnull
+ crashlog = os.open('/var/log/nm.daemon', os.O_RDWR | os.O_APPEND | os.O_CREAT, 0644)
os.dup2(crashlog, 1)
os.dup2(crashlog, 2)
os.dup2(crashlog, 1)
os.dup2(crashlog, 2)