From: Thierry Parmentelat Date: Fri, 25 Jun 2010 13:58:00 +0000 (+0000) Subject: take down the -s (startingup) option X-Git-Tag: NodeManager-2.0-12~5 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=208ac1682093530725f297ace0f36f90584d9c57;p=nodemanager.git take down the -s (startingup) option --- diff --git a/accounts.py b/accounts.py index 4357b8b..a9461d1 100644 --- a/accounts.py +++ b/accounts.py @@ -33,8 +33,6 @@ import logger import tools -# When this variable is true, start after any ensure_created -Startingup = False # shell path -> account class association shell_acct_class = {} # account type -> account class association @@ -130,7 +128,7 @@ class Worker: self.name = name # username self._acct = None # the account object currently associated with this worker - def ensure_created(self, rec, startingup = Startingup): + def ensure_created(self, rec): """Check account type is still valid. If not, recreate sliver. If still valid, check if running and configure/start if not.""" logger.log_data_in_file(rec,"/var/lib/nodemanager/%s.rec.txt"%rec['name'], @@ -143,7 +141,8 @@ If still valid, check if running and configure/start if not.""" try: next_class.create(self.name, rec['vref']) finally: create_sem.release() if not isinstance(self._acct, next_class): self._acct = next_class(rec) - if not self.is_running() or startingup or next_class != curr_class: + logger.verbose("accounts.ensure_created: %s, running=%r"%(self.name,self.is_running())) + if not self.is_running() or next_class != curr_class: self.start(rec) else: self._acct.configure(rec) diff --git a/initscripts/nm b/initscripts/nm index 2d5e024..15ddefe 100755 --- a/initscripts/nm +++ b/initscripts/nm @@ -14,11 +14,11 @@ [ -f /etc/sysconfig/nodemanager ] && . /etc/sysconfig/nodemanager -options=${OPTIONS-"-d -s"} -restartoptions=${RESTARTOPTIONS-"-d"} +options=${OPTIONS-"-d"} # turn on verbosity verboseoptions=${DEBUGOPTIONS-"-v -d"} -# debug mode is interactive, and has faster period +# debug mode is interactive, and has faster period +# run in deamon mode with service nm restardebug -d debugoptions=${DEBUGOPTIONS-"-v -p 30 -r 15"} nodemanager=${NODEMANAGER-"python /usr/share/NodeManager/nodemanager.py"} @@ -49,11 +49,11 @@ case "$1" in restart|reload) shift stop - start $restartoptions "$@" + start $options "$@" ;; condrestart) shift - [ -f ${pidfile} ] && { stop; start $restartoptions "$@"; } + [ -f ${pidfile} ] && { stop; start $options "$@"; } ;; restartverbose) shift diff --git a/nodemanager.py b/nodemanager.py index 92b77ae..09bb3bb 100755 --- a/nodemanager.py +++ b/nodemanager.py @@ -51,8 +51,6 @@ class NodeManager: parser = optparse.OptionParser() parser.add_option('-d', '--daemon', action='store_true', dest='daemon', default=False, help='run daemonized') - parser.add_option('-s', '--startup', action='store_true', dest='startup', default=False, - help='run all sliver startup scripts') parser.add_option('-f', '--config', action='store', dest='config', default='/etc/planetlab/plc_config', help='PLC configuration file') parser.add_option('-k', '--session', action='store', dest='session', default='/etc/planetlab/session', diff --git a/slivermanager.py b/slivermanager.py index d2d6131..f69fa74 100644 --- a/slivermanager.py +++ b/slivermanager.py @@ -145,7 +145,6 @@ def GetSlivers(data, config = None, plc=None, fullupdate=True): if fullupdate: database.db.set_min_timestamp(data['timestamp']) # slivers are created here. database.db.sync() - accounts.Startingup = False def deliver_ticket(data): return GetSlivers(data, fullupdate=False) @@ -156,7 +155,6 @@ def start(options, config): accounts.register_class(sliver_vs.Sliver_VS) accounts.register_class(controller.Controller) - accounts.Startingup = options.startup database.start() api_calls.deliver_ticket = deliver_ticket api.start()