X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=source%2Fsteps%2FStartRunlevelAgent.py;fp=source%2Fsteps%2FStartRunlevelAgent.py;h=d4ee55c73ebc1dfc0a4becc20f942de398b655fe;hb=7cd82eb93512460e8dd748f9737648aabf05f70d;hp=0000000000000000000000000000000000000000;hpb=0ead051299a3094173442795ee262b0900a71ecd;p=bootmanager.git diff --git a/source/steps/StartRunlevelAgent.py b/source/steps/StartRunlevelAgent.py new file mode 100644 index 0000000..d4ee55c --- /dev/null +++ b/source/steps/StartRunlevelAgent.py @@ -0,0 +1,38 @@ +#!/usr/bin/python +# +# Copyright (c) 2003 Intel Corporation +# All rights reserved. +# +# Copyright (c) 2004-2006 The Trustees of Princeton University +# All rights reserved. + + +import os + +from Exceptions import * +import BootAPI + + +def Run( vars, log ): + """ + Start the RunlevelAgent.py script. Should follow + AuthenticateWithPLC() in order to guarantee that + /etc/planetlab/session is present. + """ + + log.write( "\n\nStep: Starting RunlevelAgent.py\n" ) + + try: + cmd = "%s/RunlevelAgent.py" % vars['BM_SOURCE_DIR'] + # raise error if script is not present. + os.stat(cmd) + # init script only starts RLA once. + os.system("/usr/bin/python %s start bootmanager &" % cmd) + except KeyError, var: + raise BootManagerException, "Missing variable in vars: %s\n" % var + except ValueError, var: + raise BootManagerException, "Variable in vars, shouldn't be: %s\n" % var + + return 1 + +