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

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

adds check for connecting to psql as postgres user


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

Branch: refs/heads/master
Commit: 44410774e25e2f4d63e05d43428f8732234b66d2
Parents: 23e6730
Author: Dan Kirkwood <da...@gmail.com>
Authored: Tue Apr 18 11:15:16 2017 -0600
Committer: Dewayne Richardson <de...@apache.org>
Committed: Tue Apr 18 14:56:10 2017 -0600

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


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/44410774/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