diff --git a/lib/worker/app-worker.js b/lib/worker/app-worker.js
index 9f558fa..dfc7325 100644
--- a/lib/worker/app-worker.js
+++ b/lib/worker/app-worker.js
@@ -309,14 +309,22 @@ var AppWorker = function(appSpec, endpoint, logStream, workerId, home) {
);
})
.then(function() {
+ var env = map.compact(
+ _.extend(
+ _.omit(process.env,
+ function(v,k){ return k.substr(0,6)!=='SHINY_'; }
+ ),
+ {
+ 'HOME' : home,
+ 'LANG' : process.env['LANG'],
+ 'PATH' : process.env['PATH']
+ }
+ )
+ );
self.$proc = child_process.spawn(executable, args, {
stdio: ['pipe', 'pipe', logStream],
cwd: appSpec.appDir,
- env: map.compact({
- 'HOME' : home,
- 'LANG' : process.env['LANG'],
- 'PATH' : process.env['PATH']
- }),
+ env: env,
detached: true // So that we can send SIGINT not just to su but to the
// R process that it spawns as well
});
----