#NEWLINE# def main( ) : #NEWLINE# #INDENT# 'Entry point.' #NEWLINE# options = parse ( ) #NEWLINE# setup_logging ( options . debug , options . silent , options . name , options . syslog_facility , ( not options . no_syslog ) ) #NEWLINE# if options . pid : #NEWLINE# #INDENT# options . pid . write ( '{0}\n' . format ( os . getpid ( ) ) ) #NEWLINE# options . pid . close ( ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# options . ips = ( options . ips or loopback_ips ( options . label ) ) #NEWLINE# if ( not options . ips ) : #NEWLINE# #INDENT# logger . error ( 'No IP found' ) #NEWLINE# sys . exit ( 1 ) #NEWLINE# #UNINDENT# if options . ip_setup : #NEWLINE# #INDENT# setup_ips ( options . ips , e . label ) #NEWLINE# #UNINDENT# drop_privileges ( options . user , options . group ) #NEWLINE# options . ips = collections . deque ( options . ips ) #NEWLINE# options . ips . rotate ( ( - options . start_ip ) ) #NEWLINE# options . ips = list ( options . ips ) #NEWLINE# loop ( options ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# logger . exception ( 'Uncaught exception: %s' , e ) #NEWLINE# sys . exit ( 1 )