From d4005120a69e52cb0e16206ddd16a6dd4dd9464c Mon Sep 17 00:00:00 2001 From: David Hill Date: Tue, 30 Oct 2018 08:55:42 -0500 Subject: [PATCH] MCOL-520 - chown sudo amazon --- oamapps/postConfigure/postConfigure.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/oamapps/postConfigure/postConfigure.cpp b/oamapps/postConfigure/postConfigure.cpp index 30b91eb38..4cfc275a4 100644 --- a/oamapps/postConfigure/postConfigure.cpp +++ b/oamapps/postConfigure/postConfigure.cpp @@ -4654,9 +4654,15 @@ bool createDbrootDirs(string DBRootStorageType) string cmd = "mount " + installDir + "/data1 > " + tmpDir + "/mount.txt 2>&1"; system(cmd.c_str()); + //if Amazon, Non-Root, and External EBS, use sudo + string SUDO = ""; + if ( amazonInstall && !rootUser && + ( DBRootStorageType == "external" ) ) + SUDO = "sudo "; + if ( !rootUser) { - cmd = "chown -R " + USER + ":" + USER + " " + installDir + "/data1 > /dev/null"; + cmd = SUDO + "chown -R " + USER + ":" + USER + " " + installDir + "/data1 > /dev/null"; system(cmd.c_str()); }