Page 1 of 1

Little env. Hack

PostPosted: Mon Jul 18, 2011 9:12 am
by jhamel
Hi there,
I did the first steps to test if we can use mv3d for our project and it looks pretty good. We run mostly linux machines and we have at our project an global preferences directory, at ~/DIRNAME/etc/ . So we insert also for the overseer server the config files to ~/..../etc/grid/overseer and ~/..../etc/grid/overseer/config. So we can start it with a shellscript that change to this env. dir and starts from there the overseer program. We do setup a shell script like this:
Code: Select all
#!/bin/sh
cd ~/vrap/etc/grid/overseer
python ~/vrap/MV/mv3d/tools/overseer/overseer.py

To run that correctly we do a little quick and dirty hack at the top of the python file, perhaps it is usefull for you:
Code: Select all
try:
    liPath = os.path.dirname( os.path.realpath( __file__ ) ).split('/')
    newPath = os.path.join('/')
    for i in range(1,len(liPath)-3):
        newPath = os.path.join(newPath,liPath[i])
    sys.path.insert(0,  newPath )
except:
    pass


Now it read the configs from our special config dirs and find the needet python modules, we set that also to the other programs, importer and so.
For us it is nice to have all config files at one location, so we can work on them from our Admin-Tool.

bye
Juergen

Re: Little env. Hack

PostPosted: Tue Jul 19, 2011 1:10 am
by SirGolan
That seems like a pretty neat trick!

For config files, you can also override the defaults in ~/.mv3d/

In particular, the overseer files would go in ~/.mv3d/overseer/services.conf

Mike