X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c9fe930b422bd1675af3adb324ede3b5aa28888c..3aaefcb3c76ff470b475d950398d01255e87712a:/lib/boot/postgresql.go diff --git a/lib/boot/postgresql.go b/lib/boot/postgresql.go index 34ccf04a88..e45c4e1686 100644 --- a/lib/boot/postgresql.go +++ b/lib/boot/postgresql.go @@ -36,9 +36,13 @@ func (runPostgreSQL) Run(ctx context.Context, fail func(error), super *Superviso return err } + if super.ClusterType == "production" { + return nil + } + iamroot := false if u, err := user.Current(); err != nil { - return fmt.Errorf("user.Current(): %s", err) + return fmt.Errorf("user.Current(): %w", err) } else if u.Uid == "0" { iamroot = true } @@ -61,7 +65,7 @@ func (runPostgreSQL) Run(ctx context.Context, fail func(error), super *Superviso if err != nil { return fmt.Errorf("user.Lookup(\"postgres\"): %s", err) } - postgresUid, err := strconv.Atoi(postgresUser.Uid) + postgresUID, err := strconv.Atoi(postgresUser.Uid) if err != nil { return fmt.Errorf("user.Lookup(\"postgres\"): non-numeric uid?: %q", postgresUser.Uid) } @@ -77,7 +81,7 @@ func (runPostgreSQL) Run(ctx context.Context, fail func(error), super *Superviso if err != nil { return err } - err = os.Chown(datadir, postgresUid, 0) + err = os.Chown(datadir, postgresUID, 0) if err != nil { return err }