16306: Fix runPassenger HOME env in non-production case.
authorTom Clegg <tom@curii.com>
Mon, 25 Jan 2021 15:45:30 +0000 (10:45 -0500)
committerTom Clegg <tom@curii.com>
Mon, 25 Jan 2021 15:45:30 +0000 (10:45 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

lib/boot/passenger.go

index 84f51d0a71d19cd6cc2a5c2f42d4947a18952e02..4203939975618f9283b462866c1f16b14d16b5dd 100644 (file)
@@ -141,12 +141,12 @@ func (runner runPassenger) Run(ctx context.Context, fail func(error), super *Sup
                }
                opts := runOptions{
                        env: append([]string{
-                               "HOME=/var/www",
                                "TMPDIR=" + super.wwwtempdir,
                        }, railsEnv...),
                }
                if super.ClusterType == "production" {
                        opts.user = "www-data"
+                       opts.env = append(opts.env, "HOME=/var/www")
                } else {
                        // This would be desirable when changing uid
                        // too, but it fails because /dev/stderr is a