-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathfcc-tutorial.context
115 lines (106 loc) · 3.41 KB
/
fcc-tutorial.context
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/sh.after
parents=$(pid=$$; while [ $pid -ne 1 ]; do pid=$(ps -o ppid= -p $pid); cat /proc/$(echo $pid)/cmdline; done)
if ! echo $parents | grep -q amiconfig; then
echo "Skipping startup script, which should only run under amiconfig daemon"
exit 0
fi
# Change to your convenience. If you do it, you need also to change the username
# in the section [cernvm] below (where you can also set the password)
__user=fccuser
__userhome=/home/${__user}
echo 'us=$1
if [ "x$us" = "x" ]; then
us=$USER
fi
kinit $us@CERN.CH
' > /usr/bin/eosinit
chmod a+x /usr/bin/eosinit
ls /cvmfs/sw.hsf.org >/dev/null
ls /cvmfs/sw-nightlies.hsf.org >/dev/null
echo 'if [ "$PS1" ]; then
if [ "x$CERNVM_HSF_ENV" = "x" ]; then
if [ "x$1" = "xdev" ]; then
. /cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh || true
else
. /cvmfs/sw.hsf.org/key4hep/setup.sh || true
fi
export CERNVM_HSF_ENV=1
fi
fi' > ${__userhome}/setup-fccsw.sh
chmod a+x ${__userhome}/setup-fccsw.sh
ls /cvmfs/clicdp.cern.ch >/dev/null
echo 'if [ "$PS1" ]; then
if [ "x$CERNVM_DIRAC_ENV" = "x" ]; then
if test "x$1" == "xdev" || test "x$1" == "xpreview" ; then
echo "Setting the development/preview DIRAC environment ..."
source /cvmfs/clicdp.cern.ch/DIRACpreview/bashrc
else
echo "Setting the production DIRAC environment ..."
source /cvmfs/clicdp.cern.ch/DIRAC/bashrc
fi
# We need to set these VARs explicitly
export X509_CERT_DIR=/cvmfs/clicdp.cern.ch/DIRAC/etc/grid-security/certificates
export X509_VOMSES=/cvmfs/clicdp.cern.ch/DIRAC/etc/grid-security/vomses
export X509_VOMS_DIR=/cvmfs/clicdp.cern.ch/DIRAC/etc/grid-security/vomsdir
echo "Initializing the DIRAC/Grid proxy ..."
dirac-proxy-init -g fcc_user
if test "x$?" = "x0" ; then
echo "Done!"
export CERNVM_DIRAC_ENV=1
export XrdSecPROTOCOL=gsi
export EOS_MGM_URL=root://eospublic.cern.ch
else
echo "Some problem occured ..."
fi
fi
fi' > ${__userhome}/setup-dirac.sh
chmod a+x ${__userhome}/setup-dirac.sh
echo ' echo " "
echo "HOME: $HOME"
# Shared folder at $HOME/host
__folder=`ls -1 /mnt/shared`
echo "found folder: ${__folder}"
ln -sf /mnt/shared/${__folder} $HOME/host
# Credential files for DIRAC
if test -d /mnt/shared/${__folder}/.globus ; then
echo $HOME
if test ! -d $HOME/.globus ; then
mkdir $HOME/.globus
fi
if test ! -d ${__userhome}/.globus/usercert.pem ; then
cp -rp /mnt/shared/${__folder}/.globus/usercert.pem $HOME/.globus/
fi
if test ! -d ${__userhome}/.globus/userkey.pem ; then
cp -rp /mnt/shared/${__folder}/.globus/userkey.pem $HOME/.globus/
fi
fi
echo " To enable EOS access please do"
echo " $ eosinit <your-cern-username>"
echo " "
echo " To enable FCCSW execute"
echo " $ source ~/setup-fccsw.sh"
echo " "
echo " To enable DIRAC execute"
echo " $ source ~/setup-dirac.sh"
echo " "
echo " The shared folder from the host is availale (read-write) under $HOME/host"
echo " " ' >> $__userhome/.bashrc
exit 0
[amiconfig]
plugins=cernvm
[cernvm]
organisations=FCC
repositories=grid,sft,clicdp
shell=/bin/bash
config_url=http://cernvm.cern.ch/config
users=fccuser:fccuser:xpass
edition=Desktop
screenRes=1280x700
keyboard=us
startXDM=on
auto_login=on
services=eosd,sshd
[ucernvm-begin]
cvmfs_branch=cernvm-sl7.cern.ch
cvmfs_server=hepvm.cern.ch
[ucernvm-end]