From ca1f85cd0501542bdfe7c952dcde33a6ee4d1765 Mon Sep 17 00:00:00 2001 From: david hill Date: Wed, 25 Oct 2017 10:16:08 -0500 Subject: [PATCH] fix rc.local amazon issue --- oam/install_scripts/post-install | 6 +++--- oamapps/postConfigure/postConfigure.cpp | 17 ++++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/oam/install_scripts/post-install b/oam/install_scripts/post-install index 8c5fb2117..c724bbe4a 100755 --- a/oam/install_scripts/post-install +++ b/oam/install_scripts/post-install @@ -184,9 +184,9 @@ $installdir/bin/clearShm > /dev/null 2>&1 systemctl=`which systemctl 2>/dev/null` #check and create rc.local file if missing -if [ ! -f /etc/rc.local ]; then +if [ ! -f /etc/rc.d/rc.local ]; then printf '%s\n' '#!/bin/bash' "#" | $SUDO tee -a /etc/rc.local > /dev/null 2>&1 - $SUDO chmod +x /etc/rc.local + $SUDO chmod +x /etc/rc.d/rc.local if [ -n "$systemctl" ]; then systemctl restart rc-local >/dev/null 2>&1 @@ -248,7 +248,7 @@ else $SUDO chmod 777 /var/lock/subsys > /dev/null 2>&1 $SUDO rm -f /var/lock/subsys/mysql-Columnstore $SUDO chmod 666 /etc/fstab - $SUDO chmod 777 /etc/rc.local + $SUDO chmod 777 /etc/rc.d/rc.local fi # install Columnstore Log Rotate File diff --git a/oamapps/postConfigure/postConfigure.cpp b/oamapps/postConfigure/postConfigure.cpp index c27d77770..cca53c2c9 100644 --- a/oamapps/postConfigure/postConfigure.cpp +++ b/oamapps/postConfigure/postConfigure.cpp @@ -23,7 +23,7 @@ * List of files being updated by post-install configure: * mariadb/columnstore/etc/Columnstore.xml * mariadb/columnstore/etc/ProcessConfig.xml -* /etc/rc.local +* /etc/rc.d/rc.local * ******************************************************************************************/ /** @@ -605,6 +605,13 @@ int main(int argc, char *argv[]) nonDistribute = true; } + // setup to start on reboot, for non-root amazon installs + if ( !rootUser ) + { + system("sudo sed -i -e 's/#sudo runuser/sudo runuser/g' /etc/rc.d/rc.local >/dev/null 2>&1"); + system("sudo chmod 777 /etc/rc.d/rc.local >/dev/null 2>&1"); + } + cout << endl; cout << "===== Setup System Server Type Configuration =====" << endl << endl; @@ -1058,10 +1065,6 @@ int main(int argc, char *argv[]) cout << "ERROR: Failed trying to update MariaDB ColumnStore System Configuration file" << endl; exit(1); } - - // setup to start on reboot - system("sudo sed -i -e 's/#sudo runuser/sudo runuser/g' /etc/rc.d/rc.local >/dev/null 2>&1"); - system("sudo chmod 777 /etc/rc.d/rc.local >/dev/null 2>&1"); } if ( pmwithum ) @@ -4010,9 +4013,9 @@ bool makeRClocal(string moduleType, string moduleName, int IserverTypeInstall) close(fd); if (rootUser) - system("cat /tmp/rc.local >> /etc/rc.local > /dev/null"); + system("cat /tmp/rc.local >> /etc/rc.d/rc.local > /dev/null"); else - system("sudo cat /tmp/rc.local >> /etc/rc.local > /dev/null"); + system("sudo cat /tmp/rc.local >> /etc/rc.d/rc.local > /dev/null"); unlink(fileName.c_str());