From 9f475233a4e89cf4dc6b7268286ca41a0664c12a Mon Sep 17 00:00:00 2001 From: david hill Date: Wed, 28 Jun 2017 16:11:24 -0500 Subject: [PATCH] MCOL-770 --- oamapps/postConfigure/postConfigure.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/oamapps/postConfigure/postConfigure.cpp b/oamapps/postConfigure/postConfigure.cpp index bca43fa35..082752943 100644 --- a/oamapps/postConfigure/postConfigure.cpp +++ b/oamapps/postConfigure/postConfigure.cpp @@ -3982,7 +3982,7 @@ bool makeRClocal(string moduleType, string moduleName, int IserverTypeInstall) if ( lines.begin() == lines.end()) return true; - string fileName = "/etc/rc.local"; + string fileName = "/tmp/rc.local"; ofstream newFile (fileName.c_str()); @@ -3993,7 +3993,14 @@ bool makeRClocal(string moduleType, string moduleName, int IserverTypeInstall) newFile.close(); close(fd); + + if (rootUser) + system("cat /tmp/rc.local >> /etc/rc.local > /dev/null"); + else + system("sudo cat /tmp/rc.local >> /etc/rc.local > /dev/null"); + unlink(fileName.c_str()); + return true; }