[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-API] [PATCH] add back in a default $PATH to subprocesses



# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1261404220 0
# Node ID d28edd3c8bd96f4f280d2e9080c0a7dfb830f889
# Parent  3dfa078d2b22ec7f821ac2388c420d10f00d546f
CA-36075: add back in a sane default $PATH for subprocesses that need it.

In particular the 'EXTSR' storage backend expects to find 'pvcreate' on the 
path. Rather than just fixing this one instance and then seeing what else 
fails, this patch should prevent this class of error recurring.

Note that the only place we actually pass a custom environment to a subprocess 
is when installing the debian etch template.

Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>

diff -r 3dfa078d2b22 -r d28edd3c8bd9 stdext/forkhelpers.ml
--- a/stdext/forkhelpers.ml     Sat Dec 19 16:37:00 2009 +0000
+++ b/stdext/forkhelpers.ml     Mon Dec 21 14:03:40 2009 +0000
@@ -20,6 +20,8 @@
    (since that would cause deadlock) *)
 
 (* XXX: this is a work in progress *)
+
+let default_path = [ "/sbin"; "/usr/sbin"; "/bin"; "/usr/bin" ]
 
 open Pervasiveext
 
@@ -201,7 +203,7 @@
 
     let env = match env with 
       |        Some e -> e
-      | None -> [||] 
+      | None -> [| "PATH=" ^ (String.concat ":" default_path) |]
     in
     Fecomms.write_raw_rpc sock (Fe.Setup {Fe.cmdargs=(cmd::args); 
env=(Array.to_list env); id_to_fd_map = id_to_fd_map});
 
1 file changed, 3 insertions(+), 1 deletion(-)
stdext/forkhelpers.ml |    4 +++-


Attachment: xen-api-libs.hg.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.