From ae6b6f5d6f832758738304325001eb0fd8a81fb4 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 11 Jun 2009 16:09:28 +0000 Subject: [PATCH] - server: 'start' now looks for programs to execute in $PATH, so the same set of binaries can be used to handle multiple projects. /bin is always prepended to $PATH to ensure that project-specific binaries always take precedence. From Gabor Gombas. svn path=/trunk/boinc/; revision=18377 --- checkin_notes | 10 ++++++++++ sched/start | 9 ++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/checkin_notes b/checkin_notes index 95856561a9..f7982fdfd9 100644 --- a/checkin_notes +++ b/checkin_notes @@ -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. + /bin is always prepended to $PATH + to ensure that project-specific binaries always take precedence. + From Gabor Gombas. + + sched/ + start diff --git a/sched/start b/sched/start index c13ac9a385..2b9210fa5c 100755 --- a/sched/start +++ b/sched/start @@ -313,14 +313,12 @@ def contains_shell_characters(command): def exec_command_string(command): args = command.strip().split() - # set default path for program to : - 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!"