[ARVADOS] created: 2.1.0-337-g64cec283d

Git user git at public.arvados.org
Thu Jan 28 15:50:27 UTC 2021


        at  64cec283d576c6a5f156cce36dd8622d28f84a9a (commit)


commit 64cec283d576c6a5f156cce36dd8622d28f84a9a
Author: Tom Clegg <tom at curii.com>
Date:   Wed Jan 27 16:06:22 2021 -0500

    17212: Propagate -listen-host to postgresql and passenger.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/lib/boot/passenger.go b/lib/boot/passenger.go
index 420393997..a3b7eb4e5 100644
--- a/lib/boot/passenger.go
+++ b/lib/boot/passenger.go
@@ -8,6 +8,8 @@ import (
 	"bytes"
 	"context"
 	"fmt"
+	"net"
+	"net/url"
 	"os"
 	"path/filepath"
 	"strings"
@@ -106,6 +108,13 @@ func (runner runPassenger) Run(ctx context.Context, fail func(error), super *Sup
 	if err != nil {
 		return fmt.Errorf("bug: no internalPort for %q: %v (%#v)", runner, err, runner.svc)
 	}
+	var host string
+	for u := range runner.svc.InternalURLs {
+		host = url.URL(u).Host
+		if h, _, err := net.SplitHostPort(host); err == nil {
+			host = h
+		}
+	}
 	var appdir string
 	if super.ClusterType == "production" {
 		appdir = "/var/lib/arvados/" + runner.varlibdir
@@ -130,7 +139,8 @@ func (runner runPassenger) Run(ctx context.Context, fail func(error), super *Sup
 		cmdline := []string{
 			"bundle", "exec",
 			"passenger", "start",
-			"-p", port,
+			"--address", host,
+			"--port", port,
 			"--log-level", loglevel,
 			"--no-friendly-error-pages",
 			"--disable-anonymous-telemetry",
diff --git a/lib/boot/postgresql.go b/lib/boot/postgresql.go
index 4ed7603d2..d105b0b62 100644
--- a/lib/boot/postgresql.go
+++ b/lib/boot/postgresql.go
@@ -113,6 +113,7 @@ func (runPostgreSQL) Run(ctx context.Context, fail func(error), super *Superviso
 			"-l",          // enable ssl
 			"-D", datadir, // data dir
 			"-k", datadir, // socket dir
+			"-h", super.cluster.PostgreSQL.Connection["host"],
 			"-p", super.cluster.PostgreSQL.Connection["port"],
 		}
 		opts := runOptions{}
diff --git a/lib/boot/supervisor.go b/lib/boot/supervisor.go
index c75e7f146..aa6e0b9d9 100644
--- a/lib/boot/supervisor.go
+++ b/lib/boot/supervisor.go
@@ -734,7 +734,7 @@ func (super *Supervisor) autofillConfig(cfg *arvados.Config) error {
 	if super.OwnTemporaryDatabase {
 		cluster.PostgreSQL.Connection = arvados.PostgreSQLConnection{
 			"client_encoding": "utf8",
-			"host":            "localhost",
+			"host":            super.ListenHost,
 			"port":            nextPort(super.ListenHost),
 			"dbname":          "arvados_test",
 			"user":            "arvados",

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list