AW: AW: [GE users] prolog/epilog

Olesen, Mark Mark.Olesen at arvinmeritor.com
Thu Oct 28 15:37:41 BST 2004


> I assume the scripts need to be in directory that is accessible to all of
> my compute nodes (exported over nfs or some such)

In my setup, I have $SGE_ROOT installed locally (eg, /opt/n1ge6), but the
$SGE_ROOT/$SGE_CELL (here /opt/n1ge6/default) mounted via NFS.

The $SGE_ROOT/$SGE_CELL/{common,spool} directories are thus globally
available - which certainly helps with shadow masters!

All my local 'stuff' -- eg, prolog, epilog, loadsensors, caches, notes to
myself, ...  -- I place under $SGE_ROOT/$SGE_CELL/site.
This seems to make sense for me.

Since we have root-squashing on most of our nfs-volumes, our 'admin_user'
($SGE_ROOT/$SGE_CELL/common/bootstrap) is set to a non-root user.

While the prolog/epilog run as the job user (or another users, as specified
via the "user@" prefix), the load_sensor runs from execd as 'root'.

For the load sensor, I revert to the admin_user as follows:

# ------------------------------------------------------------------------
#
# this script should run as 'admin_user' on this system
# admin_user is registered in 'bootstrap' (v6) or 'configuration' (v5),
# but not in both!
#
Switch2AdminUser()
{
   if [ "$UID" -eq 0 ]; then
      set -- $(fgrep admin_user \
                $SGE_ROOT/$SGE_CELL/common/bootstrap \
                $SGE_ROOT/$SGE_CELL/common/configuration 2>/dev/null)
      admin_user=$2
      if [ -z "$admin_user" -o $(echo $admin_user | tr "A-Z" "a-z") = none
]; then
         admin_user=root
      elif [ "$admin_user" != root ]; then
         exec $SGE_ROOT/utilbin/$SGE_ARCH/adminrun $admin_user $0
      fi
   fi
}
 
Switch2AdminUser


Cheers,
/mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
For additional commands, e-mail: users-help at gridengine.sunsource.net




More information about the gridengine-users mailing list