From cc158c9c968a75fcc9c5802bb3892ba34d0006ed Mon Sep 17 00:00:00 2001 From: David Hill Date: Mon, 29 Oct 2018 14:19:04 -0500 Subject: [PATCH] MCOL-520 - amazon added sudo for chmod --- oam/oamcpp/liboamcpp.cpp | 5 +++-- procmon/processmonitor.cpp | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/oam/oamcpp/liboamcpp.cpp b/oam/oamcpp/liboamcpp.cpp index aca414bf9..9b7ee2fab 100644 --- a/oam/oamcpp/liboamcpp.cpp +++ b/oam/oamcpp/liboamcpp.cpp @@ -9473,7 +9473,7 @@ std::string Oam::getMySQLPassword() /****************************************************************************************** * @brief updateFstab * -* purpose: check and get mysql user password +* purpose: Update Fstabs for Amazon EBS setup * ******************************************************************************************/ std::string Oam::updateFstab(std::string device, std::string dbrootID) @@ -9499,7 +9499,8 @@ std::string Oam::updateFstab(std::string device, std::string dbrootID) if (WEXITSTATUS(status) != 0 ) { - //update /etc/fstab with mount + //chmod before update, used on amazon ami EBS. not other systems + system("sudo chmod 666 /etc/fstab"); //update local fstab cmd = "echo " + entry + " >> /etc/fstab"; diff --git a/procmon/processmonitor.cpp b/procmon/processmonitor.cpp index 2f61ae690..482b5c2bb 100644 --- a/procmon/processmonitor.cpp +++ b/procmon/processmonitor.cpp @@ -1867,6 +1867,9 @@ void ProcessMonitor::processMessage(messageqcpp::ByteStream msg, messageqcpp::IO if (WEXITSTATUS(status) != 0 ) { + //chmod before update, used on amazon ami EBS. not other systems + system("sudo chmod 666 /etc/fstab"); + cmd = "echo " + entry + " >> /etc/fstab"; system(cmd.c_str());