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(...)
{}
//update /etc/fstab with mount
string entry = amazonDeviceName + " " + InstallDir + "/data" + itoa(*pt1) + " 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());
// fstabs
string entry = updateFstab( amazonDeviceName, itoa(*pt1));
//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
***************************************************************************/