[ARVADOS] updated: 1.3.0-2590-gfd71d1026

Git user git at public.arvados.org
Wed May 20 13:37:09 UTC 2020


Summary of changes:
 .../test/integration/anonymous_access_test.rb      |  1 +
 .../workbench/test/integration/collections_test.rb | 18 +++----
 ... => test-package-python3-arvados-cwl-runner.sh} |  0
 build/run-library.sh                               |  8 +--
 lib/install/deps.go                                | 63 +++++++++++++++-------
 sdk/cwl/fpm-info.sh                                |  5 +-
 6 files changed, 59 insertions(+), 36 deletions(-)
 copy build/package-testing/{test-package-python27-python-arvados-cwl-runner.sh => test-package-python3-arvados-cwl-runner.sh} (100%)

       via  fd71d10268cd92a8b4c1799d4479ffd4495a2a51 (commit)
       via  8fde85431678f4810f5b92650f46c437e7a400e4 (commit)
       via  c57dd2d250e15ed996dc1a873fde29eb9663f88e (commit)
       via  988181fdaf1485bea89445c1621f8344256ec707 (commit)
       via  595e6ca982543526862211dc132b46f949129447 (commit)
       via  c44aa637f62f4f0943172ccdcc3e3031c5b838c0 (commit)
       via  23113256088d36496b8b70f35a2da3d2d8710666 (commit)
       via  7322b919a6021e65859e482a52aa30bee74b7a89 (commit)
       via  e05bd78813f575d61093a0685af775d431021678 (commit)
       via  e9e56eca5f6332cd65b4b50e3ed1480780c10ac4 (commit)
      from  f7a456442db1b4513742ed7970167c044a0ef8f4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit fd71d10268cd92a8b4c1799d4479ffd4495a2a51
Author: Tom Clegg <tom at tomclegg.ca>
Date:   Wed May 20 04:03:08 2020 -0400

    16319: Fix restarting postgresql twice.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>

diff --git a/lib/install/deps.go b/lib/install/deps.go
index eee419011..ba57c20c3 100644
--- a/lib/install/deps.go
+++ b/lib/install/deps.go
@@ -327,6 +327,7 @@ rm ${zip}
 			// might never have been run.
 		}
 
+		var needcoll []string
 		// If the en_US.UTF-8 locale wasn't installed when
 		// postgresql initdb ran, it needs to be added
 		// explicitly before we can use it in our test suite.
@@ -341,31 +342,34 @@ rm ${zip}
 			if strings.Contains(string(out), "1") {
 				logger.Infof("postgresql supports collation %s", collname)
 			} else {
-				// In order for CREATE COLLATION to
-				// work, the locale must have existed
-				// when PostgreSQL started up. In most
-				// cases, either this is already true
-				// because we just started postgresql
-				// ourselves above, or systemd is here
-				// and we can force a restart.
-				if os.Getpid() != 1 {
-					if err = runBash(`sudo systemctl restart postgresql`, stdout, stderr); err != nil {
-						logger.Warn("`systemctl restart postgresql` failed; hoping postgresql does not need to be restarted")
-					} else if err = waitPostgreSQLReady(); err != nil {
-						return 1
-					}
-				}
-				cmd = exec.Command("sudo", "-u", "postgres", "psql", "-c", "CREATE COLLATION \""+collname+"\" (LOCALE = \"en_US.UTF-8\")")
-				cmd.Stdout = stdout
-				cmd.Stderr = stderr
-				cmd.Dir = "/"
-				err = cmd.Run()
-				if err != nil {
-					err = fmt.Errorf("error adding postgresql collation %s: %s", collname, err)
-					return 1
-				}
+				needcoll = append(needcoll, collname)
+			}
+		}
+		if len(needcoll) > 0 && os.Getpid() != 1 {
+			// In order for the CREATE COLLATION statement
+			// below to work, the locale must have existed
+			// when PostgreSQL started up. If we're
+			// running as init, we must have started
+			// PostgreSQL ourselves after installing the
+			// locales. Otherwise, it might need a
+			// restart, so we attempt to restart it with
+			// systemd.
+			if err = runBash(`sudo systemctl restart postgresql`, stdout, stderr); err != nil {
+				logger.Warn("`systemctl restart postgresql` failed; hoping postgresql does not need to be restarted")
+			} else if err = waitPostgreSQLReady(); err != nil {
+				return 1
+			}
+		}
+		for _, collname := range needcoll {
+			cmd := exec.Command("sudo", "-u", "postgres", "psql", "-c", "CREATE COLLATION \""+collname+"\" (LOCALE = \"en_US.UTF-8\")")
+			cmd.Stdout = stdout
+			cmd.Stderr = stderr
+			cmd.Dir = "/"
+			err = cmd.Run()
+			if err != nil {
+				err = fmt.Errorf("error adding postgresql collation %s: %s", collname, err)
+				return 1
 			}
-
 		}
 
 		withstuff := "WITH LOGIN SUPERUSER ENCRYPTED PASSWORD " + pq.QuoteLiteral(devtestDatabasePassword)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list