# The blparser must be installed on a machine where the batch system log # files are available. unique template common/blparser/config; # Should have been defined before, for example by service.tpl variable BLPARSER_HOST ?= error('BLPARSER_HOST is not defined'); variable BLPARSER_PBS_SPOOLDIR ?= if ( is_defined(TORQUE_CONFIG_DIR) ) { TORQUE_CONFIG_DIR; } else { if ( BLPARSER_BATCH_SYS == 'pbs' ) { error('TORQUE_CONFIG_DIR must be defined to configure BLParser for Torque'); } else { '' }; }; variable LSF_BINPATH ?= ''; variable LSF_CONFPATH ?= ''; #Assuming that we are using Torque > = 2.5.7 variable BLAH_TORQUE_MULTIPLE_STAGING_DIRECTIVE_BUG = { if(TORQUE_VERSION == '2.5.7-7.el5'){ return("yes"); }else{ return("no"); }; }; # Create BLParser environment config file include { 'common/blparser/blah-config' }; # blparser configuration file include { 'components/filecopy/config' }; variable BLPARSER_CONF_FILE = GLITE_LOCATION_ETC + '/blparser.conf'; variable BLPARSER_CONF_CONTENTS = { contents = "# blparser configuration file - Generated by Quattor - DO NOT EDIT\n"; contents = contents + "# PBS part\n"; contents = contents + "GLITE_CE_USE_BLPARSERPBS=" + BLPARSER_LRMS_PARAMS['pbs']['enabled'] + "\n"; contents = contents + "GLITE_CE_BLPARSERPBS_DAEMON=" + BLPARSER_LRMS_PARAMS['pbs']['enabled'] + "\n"; contents = contents + "GLITE_CE_BLPARSERPBS_DEBUGLEVEL=" + to_string(BLPARSER_LRMS_PARAMS['pbs']['logLevel']) + "\n"; contents = contents + "GLITE_CE_BLPARSERPBS_DEBUGLOGFILE=" + BLPARSER_LOG_DIR + '/' + BLPARSER_LRMS_PARAMS['pbs']['logFile'] + "\n"; contents = contents + "GLITE_CE_BLPARSERPBS_NUM=" + to_string(BLPARSER_LRMS_PARAMS['pbs']['numOfDaemons']) + "\n"; contents = contents + "GLITE_CE_BLPARSERPBS_PORT1=" + to_string(BLPARSER_LRMS_PARAMS['pbs']['port']) + "\n"; contents = contents + "GLITE_CE_BLPARSERPBS_PORT2=\n"; contents = contents + "GLITE_CE_BLPARSERPBS_CREAMPORT1=" + to_string(BLPARSER_LRMS_PARAMS['pbs']['creamPort']) + "\n"; contents = contents + "GLITE_CE_BLPARSERPBS_CREAMPORT2=\n"; contents = contents + "GLITE_CE_BLPARSERPBS_SPOOLDIR=" + BLPARSER_PBS_SPOOLDIR + "\n"; contents = contents + "# LSF part\n"; contents = contents + "GLITE_CE_USE_BLPARSERLSF=" + BLPARSER_LRMS_PARAMS['lsf']['enabled'] + "\n"; contents = contents + "GLITE_CE_BLPARSERLSF_DAEMON=" + BLPARSER_LRMS_PARAMS['lsf']['enabled'] + "\n"; contents = contents + "GLITE_CE_BLPARSERLSF_DEBUGLEVEL=" + to_string(BLPARSER_LRMS_PARAMS['lsf']['logLevel']) + "\n"; contents = contents + "GLITE_CE_BLPARSERLSF_DEBUGLOGFILE=" + BLPARSER_LOG_DIR + '/' + BLPARSER_LRMS_PARAMS['lsf']['logFile'] + "\n"; contents = contents + "GLITE_CE_BLPARSERLSF_NUM=" + to_string(BLPARSER_LRMS_PARAMS['lsf']['numOfDaemons']) + "\n"; contents = contents + "GLITE_CE_BLPARSERLSF_PORT1=" + to_string(BLPARSER_LRMS_PARAMS['lsf']['port']) + "\n"; contents = contents + "GLITE_CE_BLPARSERLSF_PORT2=\n"; contents = contents + "GLITE_CE_BLPARSERLSF_CREAMPORT1=" + to_string(BLPARSER_LRMS_PARAMS['lsf']['creamPort']) + "\n"; contents = contents + "GLITE_CE_BLPARSERLSF_CREAMPORT2=\n"; contents = contents + "GLITE_CE_BLPARSERLSF_BINPATH=" + to_string(LSF_BINPATH) + "\n"; contents = contents + "GLITE_CE_BLPARSERLSF_CONFPATH=" + to_string(LSF_CONFPATH) + "\n"; contents; }; "/software/components/filecopy/services" = npush(escape(BLPARSER_CONF_FILE), nlist("config",BLPARSER_CONF_CONTENTS, "owner","root", "perms","0644", "restart", "/sbin/service glite-ce-blah-parser restart", ) ); ###################################################################################################################################### "/software/components/chkconfig/dependencies/pre" = push("symlink"); "/software/components/chkconfig/service/glite-ce-blparser/on" = ""; "/software/components/chkconfig/service/glite-ce-blparser/startstop" = true; #----------------------------------------------------------------------------- # Logrotate # BLParser log file can grow very large, rotate daily. #----------------------------------------------------------------------------- include { 'components/altlogrotate/config' }; "/software/components/altlogrotate/entries" = { # Log files for new Blah parser if ( BLPARSER_WITH_UPDATER_NOTIFIER ) { SELF[BLAH_UPDATER_DEBUG_FILE] = nlist("pattern", GLITE_LOCATION_LOG+'/'+BLAH_UPDATER_DEBUG_FILE, "compress", true, "missingok", true, "size", '10M', "create", true, "ifempty", true, "copytruncate", true, "rotate", 50); SELF[BLAH_NOTIFIER_DEBUG_FILE] = nlist("pattern", GLITE_LOCATION_LOG+'/'+BLAH_NOTIFIER_DEBUG_FILE, "compress", true, "missingok", true, "size", '10M', "create", true, "ifempty", true, "copytruncate", true, "rotate", 50); } else { log_files = list(); # Remove potential duplicates foreach (lrms;params;BLPARSER_LRMS_PARAMS) { if ( index(params['logFile'],log_files) < 0 ) { log_files[length(log_files)] = params['logFile']; }; }; foreach (i;file;log_files) { SELF[file] = nlist("pattern", BLPARSER_LOG_DIR+'/'+file, "compress", true, "missingok", true, "frequency", "daily", "create", true, "ifempty", true, "copytruncate", true, "rotate", 90); }; }; SELF; };