umask
Create the install directory and some required subdirectories
mkdir /opt/dirac
chmod 755 /opt/dirac
mkdir /opt/dirac/sbin
Setup the runsvdir to be started up upon machine reboot and pointing to /opt/dirac/startup
create /opt/dirac/sbin/runsvdir-start
#!/bin/bash
source /opt/dirac/bashrc
RUNSVCTRL=`which runsvctrl`
chpst -u dirac $RUNSVCTRL d /opt/dirac/startup/*
killall runsv svlogd
RUNSVDIR=`which runsvdir`
exec chpst -u dirac $RUNSVDIR -P /opt/dirac/startup 'log: DIRAC runsv'
Change the permission to execute this
chmod +x /opt/dirac/sbin/runsvdir-start
echo -e '\n#Run DIRAC services and agents\nSV:123456:respawn:/opt/dirac/sbin/runsvdir-start' >> /etc/inittab
Create the DIRAC3 link
ln -s /opt/dirac/pro /opt/DIRAC3
chown -h dirac /opt/DIRAC3
Copy host-certificates
mkdir -p /opt/dirac/etc/grid-security
cp -r /PATH/TO/YOUR/CERTIFICATES/host* /opt/dirac/etc/grid-security
Set permissions for host-certificates
chmod 400 /opt/dirac/etc/grid-security/hostkey.pem
chmod 644 /opt/dirac/etc/grid-security/hostcert.pem
Make sure that everything is owned by dirac
chown -R dirac /opt/dirac
Become dirac user
su - dirac
Get the DIRAC site install scripts
cd /home/dirac
wget http://lhcbproject.web.cern.ch/lhcbproject/dist/DIRAC3/DIRAC-scripts-HEAD.tar.gz
tar xzf DIRAC-scripts-HEAD.tar.gz
rm DIRAC-scripts-HEAD.tar.gz
Get help on which options could be specified for the install script
/home/dirac/scripts/install_dirac_site.sh -h
This gives you an overview of the options you can (or must) set:
-n --name SiteName Set Site Name (mandatory)
-v --version Version DIRAC Version to install (mandatory)
-L --LogLevel LogLevel for installed Components
-P --path Path Site Installation PATH (default: /opt/dirac)
-Q --Queue Queue Batch System submit Queue (default: default)
-E --ExecQueue Queue Batch System executing Queue (default: same as Queue)
-U --User UserName User executing the script (default: dirac)
-p --platform Platform Use Platform instead of local one
-h --help Print this
/home/dirac/scripts/install_dirac_site.sh -n $YOUR_SITE_NAME -v $DIRAC_VERSION -Q $QUEUE
source /opt/dirac/bashrc
dirac-config-ce -h
Test the TaskQueueDirector Agent
/opt/dirac/runit/WorkloadManagement/TaskQueueDirector/run
If the agent works, create appropriate links in /opt/dirac/startup
cd /opt/dirac/startup
ln -s /opt/dirac/runit/WorkloadManagement/TaskQueueDirector/ WorkloadManagement_TaskQueueDirector
su -
/opt/dirac/sbin/runsvdir-start
create /etc/logrotate.d/dirac
/opt/dirac/runit/WorkloadManagement/TaskQueueDirector/log/current {
daily
rotate 30
copytruncate
compress
notifempty
missingok
}
This config file advises logrotate to make a daily backup of the logfile, compress it and clear the original logfile ( copytruncate). Backups older than 30 days will be deleted ( rotate 30). If the logfile is empty, logrotate does nothing ( notifempty). If the logfile does not exist, logrotate ignores the config file ( missingok).
To check if the config file is correct check if current.1.gz will be created after running
logrotate /etc/logrotate.d/dirac -f
ls /opt/dirac/runit/WorkloadManagement/TaskQueueDirector/log/
cd /home/dirac
cp scripts/install_dirac_site.sh ~/install_dirac_site.sh.old
wget http://lhcbproject.web.cern.ch/lhcbproject/dist/DIRAC3/DIRAC-scripts-HEAD.tar.gz
tar xzf DIRAC-scripts-HEAD.tar.gz
rm DIRAC-scripts-HEAD.tar.gz
/home/dirac/scripts/install_dirac_site.sh -n $YOUR_SITE_NAME -v $DIRAC_VERSION
source /opt/dirac/bashrc
dirac-config-ce
LbLogin
SetupDirac
echo "DIRAC\n{\n Setup = LHCb-Development\n}" > ~/.dirac.cfg
dirac-lhcb-run-test-job -p Gauss -v v37r2 -m wms -n TestJob -g
sed -i '40iLHCbApp().DDDBtag = "MC09-20090602"\nLHCbApp().CondDBtag = "sim-20090402-vc-md100"' Gauss_v37r2_Wms/OptsGaussv37r2.py
set platform=DIRAC
set site=DIRAC.Dortmund.de
sed -i "12ij.setPlatform('$platform')\nj.setDestination('$site')" Gauss_v37r2_Wms/DiracAPI_Gauss_v37r2_Wms.py
Submit Job to DIRAC
python Gauss_v37r2_Wms/DiracAPI_Gauss_v37r2_Wms.py
tailf /opt/dirac/runit/WorkloadManagement/TaskQueueDirector/log/currentFor a global overview of the number of running, failed and done jobs the DIRAC Site Monitor can be used (with a valid user certificate registered in the lhcb VO) at:
exceptions.ImportError:liblapack.so.3: cannot open shared object file: No such file or directoryinstall the lapack package. For Scientif Linux this can be done with
su - yum install lapack