Exemple #1
0
with HydrusLogger.HydrusLogger( db_dir, 'server' ) as logger:
    
    try:
        
        if action in ( 'stop', 'restart' ):
            
            ServerController.ShutdownSiblingInstance( db_dir )
            
        
        if action in ( 'start', 'restart' ):
            
            HydrusData.Print( 'Initialising controller\u2026' )
            
            threading.Thread( target = reactor.run, name = 'twisted', kwargs = { 'installSignalHandlers' : 0 } ).start()
            
            controller = ServerController.Controller( db_dir )
            
            controller.Run()
            
        
    except ( HydrusExceptions.InsufficientCredentialsException, HydrusExceptions.ShutdownException ) as e:
        
        error = str( e )
        
        HydrusData.Print( error )
        
    except:
        
        error = traceback.format_exc()
        
        HydrusData.Print( 'Hydrus server failed' )
Exemple #2
0
            try:

                if action in ('stop', 'restart'):

                    ServerController.ShutdownSiblingInstance()

                if action in ('start', 'restart'):

                    HydrusData.Print('Initialising controller...')

                    threading.Thread(target=reactor.run,
                                     kwargs={
                                         'installSignalHandlers': 0
                                     }).start()

                    controller = ServerController.Controller()

                    controller.Run()

            except HydrusExceptions.PermissionException as e:

                error = str(e)

                HydrusData.Print(error)

            except:

                error = traceback.format_exc()

                HydrusData.Print('Hydrus server failed')
Exemple #3
0
 with HydrusLogger.HydrusLogger( db_dir, 'server' ) as logger:
     
     try:
         
         if action in ( 'stop', 'restart' ):
             
             ServerController.ShutdownSiblingInstance( db_dir )
             
         
         if action in ( 'start', 'restart' ):
             
             HydrusData.Print( u'Initialising controller\u2026' )
             
             threading.Thread( target = reactor.run, kwargs = { 'installSignalHandlers' : 0 } ).start()
             
             controller = ServerController.Controller( db_dir, no_daemons, no_wal )
             
             controller.Run()
             
         
     except HydrusExceptions.PermissionException as e:
         
         error = HydrusData.ToUnicode( e )
         
         HydrusData.Print( error )
         
     except:
         
         error = traceback.format_exc()
         
         HydrusData.Print( 'Hydrus server failed' )