U

����� ge����������������������@���sP���d�Z�dgZddlZddlZddlZddlZddlZddlZddl	Zddd�Z
dS�)z�!Contains setup(), which initializes the produtil package.

This module contains the setup() function that should be called once
by every Python process started, immediately after Python starts.�setup�����NF����c�����������������K���s����|dk	rt��|��|dk	r&tj�|��tjjf�d|i|���tjj|�d��tj	j
|||d��|dk	rrtj�|��n
tj�
���dS�)a���!Initializes the produtil package.  Calls the module
    initialization functions for all other modules in the produtil
    package.

    At present, it:

    1. Installs signal handlers that will cleanly abort the process.
    2. Sets up logging to the jlogfile, if $jlogfile is in the environment.
    3. Sets up logging to stdout and stderr.
    4. Sets up the produtil.dbnalert module so DBNAlert objects will
    function properly
    5. Sets the produtil.cluster's idea of what cluster it is on.  If no
    cluster is specified, the produtil.cluster is instructed to guess.

    This is a wrapper around the produtil.sigsafety, and produtil.log,
    and other module initializers.  Note that one could call each
    module's initialization functions directly instead.  However, one
    would have to keep up with changes to the produtil package during
    upgrades in order to do that.

    @param ignore_hup if True, this program will ignore SIGHUP.  Use
      this for UNIX daemon processes.  Turned off (False) by default,
      causing SIGHUP to be a terminal signal.
    @param dbnalert_logger  sent to dbnalert.init_module's logger argument
       to initialize the logging domain for informational messages
       about dbn alerts
    @param jobname  dbn_alert job string
    @param cluster  if specified and not None, sent to produtil.cluster's
      set_cluster.  Otherwise, produtil.cluster.where() is called to
      guess the cluster, or set suitable defaults.
    @param send_dbn  should dbn alerts be sent?
    @param thread_logger  if True, log messages will include thread name.
    @param thread_stack  passed to threading.stack_size(); the stack size in
      bytes for new threads.  The default is 2**24, which is 16 MB.
      See the threading module for details.  Set to None to disable
      changing of the threading stack size.
    @param kwargs all other keyword args sent to produtil.log.configureLogging()N�
thread_logger)�
ignore_hup)�logger�jobname�send_dbn)�	threading�
stack_size�produtil�batchsystem�set_default_name�log�configureLogging�	sigsafety�install_handlersZdbnalertZinit_module�cluster�set_cluster�where)r���Zdbnalert_loggerr���r���r���r���Zthread_stack�kwargs��r����;/lfs/h1/ops/prod/packages/hmon.v3.2.7/ush/produtil/setup.pyr������s����,

�)FNNNNFr���)�__doc__�__all__�loggingr	����produtil.sigsafetyr����produtil.logZprodutil.dbnalert�produtil.cluster�produtil.batchsystemr���r���r���r���r����<module>���s��� �������