U gh@sPdZdgZddlZddlZddlZddlZddlZddlZddl ZdddZ 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.setupNFcKs|dk rt||dk r&tj|tjjfd|i|tjj|dtj 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)loggerjobnamesend_dbn) threading stack_sizeprodutilZ batchsystemZset_default_namelogZconfigureLoggingZ sigsafetyZinstall_handlersdbnalertZ init_moduleclusterZ set_clusterwhere)rZdbnalert_loggerrrrrZ thread_stackkwargsr;/lfs/h1/ops/prod/packages/hafs.v2.0.7/ush/produtil/setup.pyrs,   )FNNNNFr) __doc____all__loggingr Zprodutil.sigsafetyr produtil.logprodutil.dbnalertZprodutil.clusterZprodutil.batchsystemrrrrrs