- server: 'start' now looks for programs to execute in $PATH,

so the same set of binaries can be used to handle multiple projects.
    <projectroot>/bin is always prepended to $PATH
    to ensure that project-specific binaries always take precedence.
    From Gabor Gombas.

svn path=/trunk/boinc/; revision=18377
This commit is contained in:
David Anderson 2009-06-11 16:09:28 +00:00
parent b7406ef57c
commit ae6b6f5d6f
2 changed files with 16 additions and 3 deletions

View File

@ -5364,3 +5364,13 @@ David 11 June 2009
sched/
start
assimilator.py
David 11 June 2009
- server: 'start' now looks for programs to execute in $PATH,
so the same set of binaries can be used to handle multiple projects.
<projectroot>/bin is always prepended to $PATH
to ensure that project-specific binaries always take precedence.
From Gabor Gombas.
sched/
start

View File

@ -313,14 +313,12 @@ def contains_shell_characters(command):
def exec_command_string(command):
args = command.strip().split()
# set default path for program to <bin_dir>:
args[0] = os.path.realpath(os.path.join( bin_dir, args[0] ))
os.chdir(tmp_dir)
try:
if contains_shell_characters(command):
os.execl('/bin/sh', 'sh', '-c', ' '.join(args))
else:
os.execv( args[0], args )
os.execvp( args[0], args )
# on success we don't reach here
print >>sys.stderr, "Couldn't exec '%s'"%command
except OSError, e:
@ -711,6 +709,11 @@ pid_dir = ensure_get_dir('pid_'+local_hostname)
is_main_host = config.config.host == local_hostname
if os.getenv('PATH'):
os.putenv('PATH', bin_dir + ':' + os.getenv('PATH'))
else:
os.putenv('PATH', bin_dir)
start_lockfile = os.path.join(pid_dir, 'start.lock.'+local_hostname)
if lock_file(start_lockfile):
print >>sys.stderr, "start is currently running!"