Chapter 12. Investigating your system

Table of Contents

Appendix
Script to generate the Gridmap file

Appendix

The Appendix included details of additional scripts

Script to generate the Gridmap file

This script downloads and installs two RPM's

edg-mkgridmap 
edg-mkgridmap-conf

Creates the file /opt/edg/etc/edg-mkgridmap.conf and then runs the application /opt/edg/sbin/edg-mkgridmap and sets creates a scheduled operation to keep edg-mkgridmap up to date.

#!/bin/sh

# Attempt to build a mkgridmap file.

yum -y -d 0 -t install edg-mkgridmap edg-mkgridmap-conf

cat <<EOF>/opt/edg/etc/edg-mkgridmap.conf
 
# Map VO members  cms
group ldap://grid-vo.nikhef.nl/ou=lcg1,o=cms,dc=eu-datagrid,dc=org
.cms
 
# Map VO members  dteam
group ldap://lcg-vo.cern.ch/ou=lcg1,o=dteam,dc=lcg,dc=org .dteam

# A list of authorised users.
auth
ldap://lcg-registrar.cern.ch/ou=users,o=registrar,dc=lcg,dc=org

gmf_local /opt/edg/etc/grid-mapfile-local

EOF

touch /opt/edg/etc/grid-mapfile-local

/opt/edg/sbin/edg-mkgridmap
--output=/etc/grid-security/grid-mapfile --safe
                                                                   
                                                      
cat<<EOF>/etc/cron.d/edg-mkgridmap
50 */6 * * *  root /opt/edg/sbin/edg-mkgridmap
--output=/etc/grid-security/grid-mapfile --safe
EOF