diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index 6d07b4716..affce11e7 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -2022,6 +2022,7 @@ def doFullSync(): db.query('stop slave') writeDbSyncStatus({'code': 3, 'msg': '停止从库完成...', 'progress': 45}) + print(cmd_data) dlist = db.query(cmd_data['data']) writeDbSyncStatus({'code': 4, 'msg': '刷新从库同步信息完成...', 'progress': 50}) @@ -2055,7 +2056,7 @@ def fullSync(version=''): status_file = '/tmp/db_async_status.txt' if args['begin'] == '1': - cmd = 'cd ' + mw.getRunDir() + ' && python ' + \ + cmd = 'cd ' + mw.getRunDir() + ' && python3 ' + \ getPluginDir() + \ '/index.py do_full_sync {"db":"' + args['db'] + '"} &' print(cmd) diff --git a/plugins/mysql/init.d/mysql.tpl b/plugins/mysql/init.d/mysql.tpl index d2dac7bc3..6a0a54174 100644 --- a/plugins/mysql/init.d/mysql.tpl +++ b/plugins/mysql/init.d/mysql.tpl @@ -250,9 +250,10 @@ parse_server_arguments `$print_defaults $extra_args mysqld server mysql_server m # # Set pid file if not given # +found_pid=`cd $datadir && ls |grep '.pid'` if test -z "$mysqld_pid_file_path" then - mysqld_pid_file_path=$datadir/`hostname`.pid + mysqld_pid_file_path=$datadir/$found_pid else case "$mysqld_pid_file_path" in /* ) ;; diff --git a/plugins/mysql/init.d/mysql8.0.tpl b/plugins/mysql/init.d/mysql8.0.tpl index 5e62992a7..dda204c6b 100755 --- a/plugins/mysql/init.d/mysql8.0.tpl +++ b/plugins/mysql/init.d/mysql8.0.tpl @@ -241,9 +241,10 @@ parse_server_arguments `$print_defaults $extra_args mysqld server mysql_server m # # Set pid file if not given # +found_pid=`cd $datadir && ls |grep '.pid'` if test -z "$mysqld_pid_file_path" then - mysqld_pid_file_path=$datadir/`hostname`.pid + mysqld_pid_file_path=$datadir/$found_pid else case "$mysqld_pid_file_path" in /* ) ;;