// will be retrieved (used by AliShuttle).
//
-
+#include <Riostream.h>
#include "AliShuttleConfig.h"
#include "AliShuttleInterface.h"
fDAQlbTable(other.fDAQlbTable),
fShuttlelbTable(other.fShuttlelbTable),
fRunTypelbTable(other.fRunTypelbTable),
+ fPasswdFilePath(other.fPasswdFilePath),
fMaxRetries(other.fMaxRetries),
fPPTimeOut(other.fPPTimeOut),
fDCSTimeOut(other.fDCSTimeOut),
this->fDAQlbTable=other.fDAQlbTable;
this->fShuttlelbTable=other.fShuttlelbTable;
this->fRunTypelbTable=other.fRunTypelbTable;
+ this->fPasswdFilePath=other.fPasswdFilePath;
this->fMaxRetries=other.fMaxRetries;
this->fPPTimeOut=other.fPPTimeOut;
this->fDCSTimeOut=other.fDCSTimeOut;
fDAQlbTable(""),
fShuttlelbTable(""),
fRunTypelbTable(""),
+ fPasswdFilePath(""),
fMaxRetries(0),
fPPTimeOut(0),
fDCSTimeOut(0),
result += SetGlobalConfig(&globalList);
result += SetSysConfig(&sysList);
+ result += SetPasswords();
result += SetDetConfig(&detList,&dcsList);
result += SetHostConfig(&hostList);
{
// Set the global configuration (DAQ Logbook + preprocessor monitoring settings)
+
TLDAPEntry* anEntry = 0;
TLDAPAttribute* anAttribute = 0;
}
fDAQlbUser = anAttribute->GetValue();
- anAttribute = anEntry->GetAttribute("daqLbPasswd");
- if (!anAttribute) {
- AliError("Can't find daqLbPasswd attribute!");
- return 4;
- }
- fDAQlbPass = anAttribute->GetValue();
-
anAttribute = anEntry->GetAttribute("daqLbDB");
if (!anAttribute) {
AliError("Can't find daqLbDB attribute!");
fSendMail = (Bool_t) sendMailStr.Atoi();
}
+ anAttribute = anEntry->GetAttribute("passwdFilePath");
+ if (!anAttribute) {
+ AliError("Can't find Passwords File Path attribute!");
+ return 4;
+ }
+ fPasswdFilePath = anAttribute->GetValue();
+
return 0;
}
UInt_t AliShuttleConfig::SetSysConfig(TList* list)
{
// Set the online FXS configuration (DAQ + DCS + HLT)
-
+
+
TLDAPEntry* anEntry = 0;
TLDAPAttribute* anAttribute = 0;
}
fFXSdbUser[iSys] = anAttribute->GetValue();
- anAttribute = anEntry->GetAttribute("dbPasswd");
- if (!anAttribute) {
- AliError(Form ("Can't find dbPasswd attribute for %s!!",
- AliShuttleInterface::GetSystemName(iSys)));
- return 5;
- }
- fFXSdbPass[iSys] = anAttribute->GetValue();
-
anAttribute = anEntry->GetAttribute("dbName");
if (!anAttribute) {
AliError(Form ("Can't find dbName attribute for %s!!",
return 0;
}
+//______________________________________________________________________________________________
+UInt_t AliShuttleConfig::SetPasswords(){
+
+ AliInfo("Setting Passwords");
+
+ // Retrieving Passwords for DAQ lb, DAQ/DCS/HLT FXS
+
+ ifstream *inputfile = new ifstream(fPasswdFilePath.Data());
+ if (!*inputfile) {
+ AliError(Form("Error opening file %s !", fPasswdFilePath.Data()));
+ inputfile->close();
+ delete inputfile;
+ return 1;
+ }
+
+ TString line;
+ Int_t nPwd=0;
+ Int_t nPwdFake=0;
+ while (line.ReadLine(*inputfile)) {
+ TObjArray *tokens = line.Tokenize(" \t");
+ TString system = ((TObjString *)tokens->At(0))->String();
+ TString password = ((TObjString *)tokens->At(1))->String();
+ if (system.Contains("DAQ_LB")){
+ fDAQlbPass=password;
+ nPwd++;
+ AliDebug(3,Form("DAQ_LB: Password %s for %s found", password.Data(), system.Data()));
+ }
+ else if (system.Contains("DAQ_DB")){
+ fFXSdbPass[0]=password;
+ nPwd++;
+ AliDebug(3,Form("DAQ_DB: Password %s for %s found", password.Data(), system.Data()));
+ }
+ else if (system.Contains("DCS_DB")){
+ fFXSdbPass[1]=password;
+ nPwd++;
+ AliDebug(3,Form("DCS_DB: Password %s for %s found", password.Data(), system.Data()));
+ }
+ else if (system.Contains("HLT_DB")){
+ fFXSdbPass[2]=password;
+ nPwd++;
+ AliDebug(3,Form("HLT_DB: Password %s for %s found", password.Data(), system.Data()));
+ }
+ else {
+ nPwdFake++;
+ AliDebug(3,Form("%i fake line(s) found in file %s", nPwdFake, fPasswdFilePath.Data()));
+ continue;
+ }
+ delete tokens;
+ }
+
+ inputfile->close();
+ delete inputfile;
+
+ if (nPwd!=4){
+ AliError(Form("Wrong file for DAQ Logbook password found %s (some passwors missing), please Check!", fPasswdFilePath.Data()));
+ return 2;
+ }
+
+ return 0;
+
+}
//______________________________________________________________________________________________
UInt_t AliShuttleConfig::SetDetConfig(TList* detList, TList* dcsList)
{
UInt_t SetGlobalConfig(TList* globalList);
UInt_t SetSysConfig(TList* sysList);
+ UInt_t SetPasswords();
UInt_t SetDetConfig(TList* detList, TList* dcsList);
UInt_t SetHostConfig(TList* hostList);
TString fDAQlbTable; // Table name of the DAQ logbook
TString fShuttlelbTable; // Table name of the Shuttle logbook
TString fRunTypelbTable; // Table name of the Run typr logbook
+ TString fPasswdFilePath; // Path for the local file where the passwords are stored
TString fFXSHost[3]; // Host of the [DAQ, DCS, HLT] File eXchange Server
UInt_t fFXSPort[3]; // Port of the [DAQ, DCS, HLT] File eXchange Server
-# DAQ config
dn: system=DAQ,o=shuttle,dc=cern,dc=ch
objectClass: top
objectClass: fxsConfig
system: DAQ
-dbHost: aldaqgw01-gpn.cern.ch
dbPort: 1444
-dbPasswd: alice
dbUser: shuttle_test_rw
dbName: SHUTTLE_TEST
-dbTable: daqFES_files
-fxsHost: aldaqgw01-gpn.cern.ch
fxsPort: 1443
fxsUser: shuttle_test_rw
-fxsAdmin: sylvain.chapeland@cern.ch
\ No newline at end of file
+dbTable: daqFES_files
+dbHost: aldaqgw01-gpn.cern.ch
+fxsHost: aldaqgw01-gpn.cern.ch
+fxsBaseFolder: /home/shuttle_test_rw/FES
+
-# DCS config
dn: system=DCS,o=shuttle,dc=cern,dc=ch
objectClass: top
objectClass: fxsConfig
system: DCS
dbHost: aldcs030.cern.ch
dbUser: shuttle
-dbPasswd: DCS4Offline
dbName: dcsfileserver
dbTable: dcsfes
fxsHost: aldcs030.cern.ch
fxsUser: sshd
-fxsAdmin: peter.chochula@cern.ch
+fxsBaseFolder: /home/sshd
+
name: globalConfig
daqLbHost: aldaqgw01-gpn.cern.ch
daqLbUser: shuttle_test_rw
-daqLbPasswd: alice
daqLbDB: SHUTTLE_TEST
daqLbPort: 1444
daqLbTable: logbook
shuttleLbTable: logbook_shuttle
runTypeLbTable: logbook_detectors
-ppTimeOut: 3600
ppMaxMem: 2097152
-ppmaxRetries: 2
monitorHost: aliendb1.cern.ch
monitorTable: SHUTTLE
mode: test
triggerWait: 100
-shuttleAdmin: chiara.zampolli@cern.ch
-shuttleAdmin: raffaele.grosso@cern.ch
-sendMail: 1
keepDCSMap: 0
keepTempFolder: 0
amandaAdmin: svetozar.kapusta@cern.ch
-dcsTimeOut: 3500
nDCSretries: 5
+dcsTimeOut: 1100
+ppmaxRetries: 2
+ppTimeOut: 1200
+sendMail: 1
+passwdFilePath: /home/shuttle/.shuttle
-# HLT Config
dn: system=HLT,o=shuttle,dc=cern,dc=ch
objectClass: top
objectClass: fxsConfig
system: HLT
dbUser: shuttle
-dbPasswd: 0ffl1n3-5huttl3
dbName: hlt_logbook
-dbTable: calib_data
dbHost: alihlt-shuttle1.cern.ch
fxsHost: alihlt-shuttle1.cern.ch
fxsUser: hlt-fxs
-fxsAdmin: sebastian.bablok@cern.ch
+dbTable: calib_data_test
+fxsBaseFolder: /opt/FXS-test
+
attributetype ( FXS_CONFIG:2 NAME 'dbHost' DESC 'FXS MySQL DB host' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
attributetype ( FXS_CONFIG:3 NAME 'dbPort' DESC 'FXS MySQL DB port' SUP ipServicePort SINGLE-VALUE )
attributetype ( FXS_CONFIG:4 NAME 'dbUser' DESC 'FXS MySQL DB user' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
-attributetype ( FXS_CONFIG:5 NAME 'dbPasswd' DESC 'FXS MySQL DB passwd' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
-attributetype ( FXS_CONFIG:6 NAME 'dbName' DESC 'FXS MySQL DB name' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
-attributetype ( FXS_CONFIG:7 NAME 'dbTable' DESC 'FXS MySQL DB table' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
-attributetype ( FXS_CONFIG:8 NAME 'fxsHost' DESC 'FXS host' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
-attributetype ( FXS_CONFIG:9 NAME 'fxsPort' DESC 'FXS port' SUP ipServicePort SINGLE-VALUE )
-attributetype ( FXS_CONFIG:10 NAME 'fxsUser' DESC 'FXS user' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
-attributetype ( FXS_CONFIG:11 NAME 'fxsPasswd' DESC 'FXS Password' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
-attributetype ( FXS_CONFIG:12 NAME 'fxsAdmin' DESC 'FXS admin(s) email address' EQUALITY caseIgnoreIA5Match SUP mail )
-attributetype ( FXS_CONFIG:13 NAME 'fxsBaseFolder' DESC 'FXS Base Folder' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
+attributetype ( FXS_CONFIG:5 NAME 'dbName' DESC 'FXS MySQL DB name' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
+attributetype ( FXS_CONFIG:6 NAME 'dbTable' DESC 'FXS MySQL DB table' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
+attributetype ( FXS_CONFIG:7 NAME 'fxsHost' DESC 'FXS host' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
+attributetype ( FXS_CONFIG:8 NAME 'fxsPort' DESC 'FXS port' SUP ipServicePort SINGLE-VALUE )
+attributetype ( FXS_CONFIG:9 NAME 'fxsUser' DESC 'FXS user' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
+attributetype ( FXS_CONFIG:10 NAME 'fxsPasswd' DESC 'FXS Password' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
+attributetype ( FXS_CONFIG:11 NAME 'fxsAdmin' DESC 'FXS admin(s) email address' EQUALITY caseIgnoreIA5Match SUP mail )
+attributetype ( FXS_CONFIG:12 NAME 'fxsBaseFolder' DESC 'FXS Base Folder' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
objectclass ( FXS_CONFIG
NAME 'fxsConfig'
DESC 'ALICE: Configuration of the Shuttle for access to the File Exchange Servers'
SUP top
- MUST (system $ dbHost $ dbUser $ dbPasswd $ dbName $ dbTable $ fxsHost $ fxsUser $ fxsBaseFolder)
+ MUST (system $ dbHost $ dbUser $ dbName $ dbTable $ fxsHost $ fxsUser $ fxsBaseFolder)
MAY ( dbPort $ fxsPasswd $ fxsPort $ fxsAdmin) )
attributetype ( GLOBAL_CONFIG:1 NAME 'daqLbHost' DESC 'DAQ Logbook host' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
attributetype ( GLOBAL_CONFIG:2 NAME 'daqLbPort' DESC 'DAQ Logbook port' SUP ipServicePort SINGLE-VALUE )
attributetype ( GLOBAL_CONFIG:3 NAME 'daqLbUser' DESC 'DAQ Logbook user' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
-attributetype ( GLOBAL_CONFIG:4 NAME 'daqLbPasswd' DESC 'DAQ Logbook passwd' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
-attributetype ( GLOBAL_CONFIG:5 NAME 'daqLbDB' DESC 'DAQ Logbook DB' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
-attributetype ( GLOBAL_CONFIG:6 NAME 'daqLbTable' DESC 'DAQ Logbook table' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
-attributetype ( GLOBAL_CONFIG:7 NAME 'shuttleLbTable' DESC 'SHUTTLE Logbook table' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
-attributetype ( GLOBAL_CONFIG:8 NAME 'runTypeLbTable' DESC 'RunType Logbook table' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
-attributetype ( GLOBAL_CONFIG:9 NAME 'ppmaxRetries' DESC 'retries before pp fail' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
-attributetype ( GLOBAL_CONFIG:10 NAME 'ppTimeOut' DESC 'seconds before pp abort' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
-attributetype ( GLOBAL_CONFIG:11 NAME 'ppMaxMem' DESC 'max pp mem consumption (KB)' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
-attributetype ( GLOBAL_CONFIG:12 NAME 'monitorHost' DESC 'monitoring server host' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
-attributetype ( GLOBAL_CONFIG:13 NAME 'monitorTable' DESC 'monitoring table name' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
-attributetype ( GLOBAL_CONFIG:14 NAME 'triggerWait' DESC 'max time waiting for next trigger before starting a new collection'
+attributetype ( GLOBAL_CONFIG:4 NAME 'daqLbDB' DESC 'DAQ Logbook DB' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
+attributetype ( GLOBAL_CONFIG:5 NAME 'daqLbTable' DESC 'DAQ Logbook table' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
+attributetype ( GLOBAL_CONFIG:6 NAME 'shuttleLbTable' DESC 'SHUTTLE Logbook table' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
+attributetype ( GLOBAL_CONFIG:7 NAME 'runTypeLbTable' DESC 'RunType Logbook table' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
+attributetype ( GLOBAL_CONFIG:8 NAME 'ppmaxRetries' DESC 'retries before pp fail' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
+attributetype ( GLOBAL_CONFIG:9 NAME 'ppTimeOut' DESC 'seconds before pp abort' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
+attributetype ( GLOBAL_CONFIG:10 NAME 'ppMaxMem' DESC 'max pp mem consumption (KB)' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
+attributetype ( GLOBAL_CONFIG:11 NAME 'monitorHost' DESC 'monitoring server host' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
+attributetype ( GLOBAL_CONFIG:12 NAME 'monitorTable' DESC 'monitoring table name' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
+attributetype ( GLOBAL_CONFIG:13 NAME 'triggerWait' DESC 'max time waiting for next trigger before starting a new collection'
EQUALITY integerMatch SUP uidNumber SINGLE-VALUE )
-attributetype ( GLOBAL_CONFIG:15 NAME 'mode' DESC 'production mode (test, prod)' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
-attributetype ( GLOBAL_CONFIG:16 NAME 'shuttleAdmin' DESC 'SHUTTLE administrator(s) email address' EQUALITY caseIgnoreIA5Match SUP mail )
-attributetype ( GLOBAL_CONFIG:17 NAME 'amandaAdmin' DESC 'Amanda admin(s) email address' EQUALITY caseIgnoreIA5Match SUP mail )
+attributetype ( GLOBAL_CONFIG:14 NAME 'mode' DESC 'production mode (test, prod)' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
+attributetype ( GLOBAL_CONFIG:15 NAME 'shuttleAdmin' DESC 'SHUTTLE administrator(s) email address' EQUALITY caseIgnoreIA5Match SUP mail )
+attributetype ( GLOBAL_CONFIG:16 NAME 'amandaAdmin' DESC 'Amanda admin(s) email address' EQUALITY caseIgnoreIA5Match SUP mail )
-attributetype ( GLOBAL_CONFIG:18 NAME 'sendMail' DESC 'Send email flag (1/0)' EQUALITY integerMatch SUP uidNumber SINGLE-VALUE )
-attributetype ( GLOBAL_CONFIG:19 NAME 'keepDCSMap' DESC 'keep DCS map flag (1/0)' EQUALITY integerMatch SUP uidNumber SINGLE-VALUE )
-attributetype ( GLOBAL_CONFIG:20 NAME 'keepTempFolder' DESC 'keep temp folder flag (1/0)' EQUALITY integerMatch SUP uidNumber SINGLE-VALUE )
-attributetype ( GLOBAL_CONFIG:21 NAME 'dcsTimeOut' DESC 'seconds before dcs abort' EQUALITY integerMatch SUP uidNumber SINGLE-VALUE )
-attributetype ( GLOBAL_CONFIG:22 NAME 'nDCSretries' DESC 'number of dcs retries before abort' EQUALITY integerMatch SUP uidNumber SINGLE-VALUE )
+attributetype ( GLOBAL_CONFIG:17 NAME 'sendMail' DESC 'Send email flag (1/0)' EQUALITY integerMatch SUP uidNumber SINGLE-VALUE )
+attributetype ( GLOBAL_CONFIG:18 NAME 'keepDCSMap' DESC 'keep DCS map flag (1/0)' EQUALITY integerMatch SUP uidNumber SINGLE-VALUE )
+attributetype ( GLOBAL_CONFIG:19 NAME 'keepTempFolder' DESC 'keep temp folder flag (1/0)' EQUALITY integerMatch SUP uidNumber SINGLE-VALUE )
+attributetype ( GLOBAL_CONFIG:20 NAME 'dcsTimeOut' DESC 'seconds before dcs abort' EQUALITY integerMatch SUP uidNumber SINGLE-VALUE )
+attributetype ( GLOBAL_CONFIG:21 NAME 'nDCSretries' DESC 'number of dcs retries before abort' EQUALITY integerMatch SUP uidNumber SINGLE-VALUE )
+attributetype ( GLOBAL_CONFIG:22 NAME 'passwdFilePath' DESC 'PWD File Path' EQUALITY caseIgnoreMatch SUP name SINGLE-VALUE )
objectclass ( GLOBAL_CONFIG
NAME 'globalConfig'
DESC 'ALICE: settings for DAQ logbook access'
SUP top
- MUST (name $ daqLbHost $ daqLbUser $ daqLbPasswd $ daqLbDB $ daqLbTable $ shuttleLbTable $ runTypeLbTable $ ppMaxRetries $ ppTimeOut $ ppMaxMem $ dcsTimeOut $ nDCSretries $ monitorHost $ monitorTable)
+ MUST (name $ passwdFilePath $ daqLbHost $ daqLbUser $ daqLbDB $ daqLbTable $ shuttleLbTable $ runTypeLbTable $ ppMaxRetries $ ppTimeOut $ ppMaxMem $ dcsTimeOut $ nDCSretries $ monitorHost $ monitorTable)
MAY ( daqLbPort $ triggerWait $ mode $ keepDCSMap $ keepTempFolder $ shuttleAdmin $ amandaAdmin $ sendMail) )
-# DAQ config
dn: system=DAQ,o=shuttle_prod,dc=cern,dc=ch
objectClass: top
objectClass: fxsConfig
system: DAQ
dbHost: aldaqgw01-gpn.cern.ch
-dbPort: 1444
-dbPasswd: alice
dbUser: shuttle
dbName: FES
dbTable: daqFES_files
fxsHost: aldaqgw01-gpn.cern.ch
fxsPort: 1443
fxsUser: shuttle
+dbPort: 1444
+fxsBaseFolder: /home/shuttle/FES
+fxsAdmin: sylvain.chapeland@cern.ch
-# DCS config
dn: system=DCS,o=shuttle_prod,dc=cern,dc=ch
objectClass: top
objectClass: fxsConfig
system: DCS
dbHost: alidcsfxs.cern.ch
dbUser: fesclient
-dbPasswd: alicedcs
dbName: dcsfileserver
dbTable: dcsfes
fxsHost: alidcsfxs.cern.ch
fxsUser: shuttle
+fxsBaseFolder: /data/shuttle
+fxsAdmin: peter.chochula@cern.ch
name: globalConfig
daqLbHost: aldaqgw01-gpn.cern.ch
daqLbUser: shuttle
-daqLbPasswd: alice
daqLbDB: LOGBOOK
daqLbPort: 1444
daqLbTable: logbook
shuttleLbTable: logbook_shuttle
runTypeLbTable: logbook_detectors
ppMaxMem: 2097152
-ppmaxRetries: 2
monitorHost: aliendb1.cern.ch
monitorTable: SHUTTLE_PROD
mode: prod
keepTempFolder: 1
dcsTimeOut: 1100
sendMail: 1
-shuttleAdmin: chiara.zampolli@cern.ch
-shuttleAdmin: raffaele.grosso@cern.ch
amandaAdmin: svetozar.kapusta@cern.ch
nDCSretries: 5
+ppmaxRetries: 2
+passwdFilePath: /home/shuttle/.shuttle_prod
-# HLT Config
dn: system=HLT,o=shuttle_prod,dc=cern,dc=ch
objectClass: top
objectClass: fxsConfig
system: HLT
dbUser: shuttle
-dbPasswd: 0ffl1n3-5huttl3
dbName: hlt_logbook
dbTable: calib_data
dbHost: alihlt-shuttle1.cern.ch
fxsHost: alihlt-shuttle1.cern.ch
fxsUser: hlt-fxs
+fxsBaseFolder: /opt/FXS
+fxsAdmin: sebastian.bablok@cern.ch
+fxsAdmin: jochen.thaeder@cern.ch