You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by fr...@apache.org on 2017/04/20 18:40:30 UTC

[41/44] incubator-trafficcontrol git commit: adds check for connecting to psql as postgres user

adds check for connecting to psql as postgres user

(cherry picked from commit 44410774e25e2f4d63e05d43428f8732234b66d2)


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/cddedc74
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/cddedc74
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/cddedc74

Branch: refs/heads/2.0.x
Commit: cddedc74d5d3627acca15c0912a69b746e95fe15
Parents: 88ffcf6
Author: Dan Kirkwood <da...@gmail.com>
Authored: Tue Apr 18 11:15:16 2017 -0600
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Wed Apr 19 15:36:20 2017 -0600

----------------------------------------------------------------------
 traffic_ops/install/bin/postinstall | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/cddedc74/traffic_ops/install/bin/postinstall
----------------------------------------------------------------------
diff --git a/traffic_ops/install/bin/postinstall b/traffic_ops/install/bin/postinstall
index 849860a..4c1b035 100755
--- a/traffic_ops/install/bin/postinstall
+++ b/traffic_ops/install/bin/postinstall
@@ -22,6 +22,11 @@ for p in git go; do
 	type $p >/dev/null 2>&1 || { echo >&2 "postinstall requires $p but it's not installed.  Aborting."; exit 1; }
 done
 
+if [[ ! $(su - postgres psql -w -c 'show is_superuser' </dev/null 2>/dev/null) =~ 'on' ]]; then
+	echo >&2 "postinstall requires the postgres user to have superuser access to postgresql. Aborting."
+	exit 1
+fi
+
 # install carton first
 cpanm Carton