+ "--disable-anonymous-telemetry",
+ "--disable-security-update-check",
+ "--no-compile-runtime",
+ "--no-install-runtime",
+ "--pid-file", filepath.Join(super.wwwtempdir, "passenger."+strings.Replace(appdir, "/", "_", -1)+".pid"),
+ }
+ if super.ClusterType == "production" {
+ cmdline = append([]string{"sudo", "-u", "www-data", "-E", "HOME=/var/www", "PATH=/var/lib/arvados/bin:" + os.Getenv("PATH"), "/var/lib/arvados/bin/bundle"}, cmdline[1:]...)
+ } else {
+ // This would be desirable in the production
+ // case too, but it fails with sudo because
+ // /dev/stderr is a symlink to a pty owned by
+ // root: "nginx: [emerg] open() "/dev/stderr"
+ // failed (13: Permission denied)"
+ cmdline = append(cmdline, "--log-file", "/dev/stderr")
+ }
+ env := append([]string{"TMPDIR=" + super.wwwtempdir}, railsEnv...)
+ err = super.RunProgram(ctx, appdir, nil, env, cmdline[0], cmdline[1:]...)