#NEWLINE# @ classmethod #NEWLINE# def start_remote_appcontroller( cls , host , keyname , is_verbose ) : #NEWLINE# #INDENT# 'Starts the AppController daemon on the specified host.\n\n    Args:\n      host: A str representing the host to start the AppController on.\n      keyname: A str representing the name of the SSH keypair that can log into\n        the specified host.\n      is_verbose: A bool that indicates if we should print the commands needed\n        to start the AppController to stdout.\n    ' #NEWLINE# AppScaleLogger . log ( 'Starting AppController at {0}' . format ( host ) ) #NEWLINE# cls . ssh ( host , cls , 'rm -rf {}/appcontroller-state.json' . format ( cls . CONFIG_DIR ) , is_verbose ) #NEWLINE# cls . ssh ( host , keyname , 'rm -rf /etc/monit/conf.d/appscale-*.cfg' , is_verbose ) #NEWLINE# cls . scp ( host , keyname , cls . MONIT_APPCONTROLLER_CONFIG_FILE , '/etc/monit/conf.d/appscale-controller-17443.cfg' , is_verbose ) #NEWLINE# cls . ssh ( host , keyname , 'monit quit; ' , is_verbose ) #NEWLINE# cls . ssh ( host , keyname , 'service monit start' , is_verbose ) #NEWLINE# time . sleep ( 1 ) #NEWLINE# cls . ssh ( host , keyname , 'monit start -g controller' , is_verbose ) #NEWLINE# time . sleep ( 1 ) #NEWLINE# AppScaleLogger . log ( ( 'Please wait for the AppController to finish ' + 'pre-processing tasks.' ) ) #NEWLINE# cls . sleep_until_port_is_open ( host , AppControllerClient . PORT , is_verbose )