[GE users] Environment leaking

beatrubi beat at 0x1b.ch
Tue Dec 15 11:10:57 GMT 2009


I had a quite strange effect in GE6.2u3 on SLES10. During the weekend I
restarted all the execution daemons. After this step the PATH was no longer
set correctly for user jobs.

Doing some debugging I found that the environment of the process starting
/etc/init.d/sgeexecd is passed to the users jobs. As I used ssh to start the
execution daemons I found also some SSH related variables :-)

    beat at master:~> cat envtest.sub

    #$ -N EnvTest
    #$ -S /bin/sh
    #$ -cwd
    #$ -j y


    beat at master:~> qsub envtest.sub
    Your job 208 ("EnvTest") has been submitted

    beat at master:~> cat EnvTest.o208
    SSH_CLIENT=' 40038 22'
    SSH_CONNECTION=' 40038 22'

The variable $PROFILEREAD is used by SuSE to avoid a second sourcing of
/etc/profile. It was set by the root shell I used to start the execution
daemon. Passed through the init script, sge_execd and sge_shepherd to the
login shell of the job. And there it avoided a clean setup of the

In my understanding each program starting user shells should cleanup the
environment. login and ssh does, even the good old in.telnetd does. Why not

To workaround my problem I added a line to my init scripts:

--- sgeexecd.cluster.orig    2009-12-12 10:09:46.383474352 +0100
+++ sgeexecd.cluster    2009-12-15 11:30:44.920153858 +0100
@@ -36,6 +36,10 @@
+# Delete environment - sge_execd and sge_shepherd are leaking
+unset `env | awk -F= '{ print $1 }'`
 # This script can be called with the following arguments:
 #       start       start execution daemon


     \|/                           Beat Rubischon <beat at 0x1b.ch>
   ( 0^0 )                             http://www.0x1b.ch/~beat/
Meine Erlebnisse, Gedanken und Traeume: http://www.0x1b.ch/blog/


To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net].

More information about the gridengine-users mailing list