From 3fa341123288b01ff68a89d3febe4fa34f8b25c1 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 8 Jul 2022 00:48:15 +0800 Subject: [PATCH] Update index.py --- plugins/mysql-ya/index.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/mysql-ya/index.py b/plugins/mysql-ya/index.py index 4d3a1f8e9..8d282fd1c 100755 --- a/plugins/mysql-ya/index.py +++ b/plugins/mysql-ya/index.py @@ -168,7 +168,7 @@ def initDreplace(version=''): def status(version=''): - pid = getServerDir() + '/data/mysql.pid' + pid = getPidFile() if not os.path.exists(pid): return 'stop' return 'start' @@ -182,6 +182,14 @@ def getDataDir(): return tmp.groups()[0].strip() +def getPidFile(): + file = getConf() + content = mw.readFile(file) + rep = 'pid-file\s*=\s*(.*)' + tmp = re.search(rep, content) + return tmp.groups()[0].strip() + + def binLog(): args = getArgs() conf = getConf()