diff options
author | James Meyer <james.meyer@operamail.com> | 2012-08-17 02:18:56 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2012-08-17 02:18:56 (GMT) |
commit | c77b4d5e0aeddadce9867f82cf42cd707e3720e3 (patch) | |
tree | 1ce4bb145c09c4217eece865a1a8c5d629d29768 /abs/core/LinHES-config/mv_hostype.py | |
parent | 7f9587e68adac4dea88300060b3f3b3a612433cf (diff) | |
download | linhes_pkgbuild-c77b4d5e0aeddadce9867f82cf42cd707e3720e3.zip linhes_pkgbuild-c77b4d5e0aeddadce9867f82cf42cd707e3720e3.tar.gz linhes_pkgbuild-c77b4d5e0aeddadce9867f82cf42cd707e3720e3.tar.bz2 |
LinHES-config: fix hostype change after a system is installed.
Diffstat (limited to 'abs/core/LinHES-config/mv_hostype.py')
-rwxr-xr-x | abs/core/LinHES-config/mv_hostype.py | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/abs/core/LinHES-config/mv_hostype.py b/abs/core/LinHES-config/mv_hostype.py index 2f2ceab..21a22b4 100755 --- a/abs/core/LinHES-config/mv_hostype.py +++ b/abs/core/LinHES-config/mv_hostype.py @@ -38,7 +38,7 @@ def setup_db(): def setup_mysqlnetwork(EnableNetwork): logging.debug(" Setting up mysql network") - mysqlconf = "/etc/my.cnf" + mysqlconf = "/etc/mysql/my.cnf" cmd = '''grep "#skip-networking" %s ''' %mysqlconf status = mv_common.runcmd(cmd) @@ -49,7 +49,7 @@ def setup_mysqlnetwork(EnableNetwork): else: cmd = '''sed -ie "s/^skip-networking/#skip-networking/g" %s ''' %mysqlconf mv_common.runcmd(cmd) - mv_common.restart_service("mysqld") + mv_common.restart_service("mysql") else: logging.debug(" Disabling mysql networking") if status == 1 : @@ -57,7 +57,7 @@ def setup_mysqlnetwork(EnableNetwork): else: cmd = '''sed -ie "s/#skip-networking/skip-networking/g" %s ''' %mysqlconf mv_common.runcmd(cmd) - mv_common.restart_service("mysqld") + mv_common.restart_service("mysql") def generate_config_xml(uuid,dbhost): @@ -107,22 +107,35 @@ def setup_mysql_connection(systemconfig): if systemtype == "Master_backend": logging.debug(" Setting dbhost to %s in systemconfig", mythip) dbhost = mythip - cmd = '''sed -ei "s/^dbhost=.*$/dbhost=\"%s\"/" /etc/systemconfig ''' %dbhost + cmd = '''sed -i "s/^dbhost=.*$/dbhost=\"%s\"/" /etc/systemconfig ''' %dbhost mv_common.runcmd(cmd) logging.debug(" Changing dbhost in settings table for master_backend") - cmd = '''%s/bin/restore_default_settings.sh -c BECONFIG -s master -a %s ''' %(mv_root, dbhost) + #cmd = '''%s/bin/restore_default_settings.sh -c BECONFIG -s master -a %s ''' %(mv_root, dbhost) + cmd = '''%s/bin/myth_settings_wrapper.sh -c BECONFIG -s master -a %s ''' %(mv_root, dbhost) mv_common.runcmd(cmd) + #mv_common.reloadfe(systemconfig.get("dbhost"),True) if systemtype == "Slave_backend": slavehost = mythip logging.debug(" Changing slave in settings: %s", slavehost) - cmd = '''%s/bin/restore_default_settings.sh -c BECONFIG -s slave -a %s ''' %(mv_root, slavehost) + cmd = '''%s/bin/myth_settings_wrapper.sh -c BECONFIG -s slave -a %s ''' %(mv_root, slavehost) + #cmd = '''%s/bin/restore_default_settings.sh -c BECONFIG -s slave -a %s ''' %(mv_root, slavehost) mv_common.runcmd(cmd) - if systemtype == "Master_backend": + if systemtype == "Standalone": logging.debug(" changing mysql.txt file to use localhost") cmd = '''sed -e "s/^DBHostName=.*$/DBHostName="localhost"/" %s > %s ''' %(mysqltemplate, mysqltxt) mv_common.runcmd(cmd) + + #mv_common.reloadfe(systemconfig.get("dbhost"),True) + + cmd = '''%s/bin/myth_settings_wrapper.sh -c BECONFIG -s standalone ''' %(mv_root) + mv_common.runcmd(cmd) + #mv_common.reloadfe(systemconfig.get("dbhost"),True) + + logging.debug(" Running beconfig a 2nd time") + cmd = '''%s/bin/myth_settings_wrapper.sh -c BECONFIG -s standalone ''' %(mv_root) + mv_common.runcmd(cmd) else: logging.debug(" changing mysql.txt file to use %s", dbhost) cmd = '''sed -e "s/^DBHostName=.*$/DBHostName=%s/" %s > %s ''' %(dbhost, mysqltemplate, mysqltxt) @@ -378,8 +391,10 @@ def hostypeprint(systemconfig): if data_config.SYSTEMTYPE == "MythVantage": mv_common.remove_service("ghosd") + if restart_mbe == True : - mv_common.restart_service("mythbackend") + setup_mysql_connection(systemconfig) + mv_common.stop_service("mythbackend") if run_mysqlnetwork: @@ -388,6 +403,11 @@ def hostypeprint(systemconfig): logging.debug(" Not running setup_mysql_connection") setup_mysql_connection(systemconfig) + + if restart_mbe == True : + mv_common.start_service("mythbackend") + + if func_supported: setup_func_minion(systemconfig.get("dbhost"),systemconfig.get("hostname")) |