From d511249fe35d7a7ce38806ca54594b947150a3d1 Mon Sep 17 00:00:00 2001 From: midoks Date: Fri, 8 Jul 2022 00:47:17 +0800 Subject: [PATCH] Update index.py --- plugins/mysql/index.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/mysql/index.py b/plugins/mysql/index.py index 18ce9f378..a25eab6c8 100755 --- a/plugins/mysql/index.py +++ b/plugins/mysql/index.py @@ -197,7 +197,7 @@ def status(version=''): if data[0] == '': return 'stop' - pid = getServerDir() + '/data/mysql.pid' + pid = getPidFile() if not os.path.exists(pid): return 'stop' @@ -212,6 +212,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()