1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

update fstab changes

This commit is contained in:
david hill
2016-04-20 15:58:11 -05:00
parent 26c4dd5982
commit 010c3d08b1
4 changed files with 43 additions and 32 deletions

View File

@ -6198,20 +6198,13 @@ namespace oam
} }
catch(...) catch(...)
{} {}
//update /etc/fstab with mount
string entry = amazonDeviceName + " " + InstallDir + "/data" + itoa(*pt1) + " ext2 noatime,nodiratime,noauto 0 0";
//update local fstab // fstabs
cmd = "echo " + entry + " >> /etc/fstab"; string entry = updateFstab( amazonDeviceName, itoa(*pt1));
system(cmd.c_str());
//use from addmodule later
cmd = "echo " + entry + " >> " + InstallDir + "/local/etc/pm1/fstab";
system(cmd.c_str());
//send update pms //send update pms
distributeFstabUpdates(entry); if (entry != "" )
distributeFstabUpdates(entry);
} }
} }
@ -8467,6 +8460,36 @@ namespace oam
} }
/******************************************************************************************
* @brief updateFstab
*
* purpose: check and get mysql user password
*
******************************************************************************************/
std::string Oam::updateFstab(std::string device, std::string dbrootID)
{
//check if entry already exist
string cmd = "grep /data" + dbrootID + " > /etc/fstab /dev/null 2>&1";
int status = system(cmd.c_str());
if (WEXITSTATUS(status) == 0 )
return "";
//update /etc/fstab with mount
string entry = device + " " + InstallDir + "/data" + dbrootID + " ext2 noatime,nodiratime,noauto 0 0";
//update local fstab
cmd = "echo " + entry + " >> /etc/fstab";
system(cmd.c_str());
//use from addmodule later
cmd = "echo " + entry + " >> " + InstallDir + "/local/etc/pm1/fstab";
system(cmd.c_str());
return entry;
}
/*************************************************************************** /***************************************************************************
* PRIVATE FUNCTIONS * PRIVATE FUNCTIONS
***************************************************************************/ ***************************************************************************/

View File

@ -2436,6 +2436,10 @@ namespace oam
*/ */
EXPORT std::string getMySQLPassword(bool bypassConfig = false); EXPORT std::string getMySQLPassword(bool bypassConfig = false);
/** @brief update fstab with dbroot mounts
*/
EXPORT std::string updateFstab(std::string device, std::string dbrootID);
private: private:
int sendMsgToProcMgr3(messageqcpp::ByteStream::byte requestType, snmpmanager::AlarmList& alarmlist, const std::string date); int sendMsgToProcMgr3(messageqcpp::ByteStream::byte requestType, snmpmanager::AlarmList& alarmlist, const std::string date);

View File

@ -1723,7 +1723,7 @@ int processCommand(string* arguments)
cout << endl; cout << endl;
oam.getSystemConfig("PMVolumeSize", EBSsize); oam.getSystemConfig("PMVolumeSize", EBSsize);
string prompt = "Enter EBS storage size in GB: (" + EBSsize + "): "; string prompt = "Enter EBS storage size in GB, current setting is " + EBSsize + " : ";
EBSsize = dataPrompt(prompt); EBSsize = dataPrompt(prompt);
} }
} }

View File

@ -2526,16 +2526,8 @@ int main(int argc, char *argv[])
deviceName = boost::get<0>(st); deviceName = boost::get<0>(st);
amazondeviceName = boost::get<1>(st); amazondeviceName = boost::get<1>(st);
//update /etc/fstab with mount // fstabs
string entry = amazondeviceName + " " + installDir + "/data" + *it + " ext2 noatime,nodiratime,noauto 0 0"; string entry = oam.updateFstab( amazondeviceName, *it);
//update local fstab
cmd = "echo " + entry + " >> /etc/fstab";
system(cmd.c_str());
//use from addmodule later
cmd = "echo " + entry + " >> " + installDir + "/local/etc/pm1/fstab";
system(cmd.c_str());
} }
else else
{ {
@ -2573,16 +2565,8 @@ int main(int argc, char *argv[])
callFree(pcommand); callFree(pcommand);
} }
//update /etc/fstab with mount // fstabs
string entry = amazondeviceName + " " + installDir + "/data" + *it + " ext2 noatime,nodiratime,noauto 0 0"; string entry = oam.updateFstab( amazondeviceName, *it);
//update local fstab
cmd = "echo " + entry + " >> /etc/fstab";
system(cmd.c_str());
//use from addmodule later
cmd = "echo " + entry + " >> " + installDir + "/local/etc/pm1/fstab";
system(cmd.c_str());
} }