mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 04:19:26 +08:00
update
This commit is contained in:
@@ -180,8 +180,7 @@ def saveConf():
|
||||
|
||||
def initdStatus():
|
||||
if not app_debug:
|
||||
os_name = public.getOs()
|
||||
if os_name == 'darwin':
|
||||
if public.isAppleSystem():
|
||||
return "Apple Computer does not support"
|
||||
initd_bin = getInitDFile()
|
||||
if os.path.exists(initd_bin):
|
||||
@@ -192,8 +191,7 @@ def initdStatus():
|
||||
def initdInstall():
|
||||
import shutil
|
||||
if not app_debug:
|
||||
os_name = public.getOs()
|
||||
if os_name == 'darwin':
|
||||
if public.isAppleSystem():
|
||||
return "Apple Computer does not support"
|
||||
|
||||
mem_bin = initDreplace()
|
||||
@@ -205,8 +203,7 @@ def initdInstall():
|
||||
|
||||
def initdUinstall():
|
||||
if not app_debug:
|
||||
os_name = public.getOs()
|
||||
if os_name == 'darwin':
|
||||
if public.isAppleSystem():
|
||||
return "Apple Computer does not support"
|
||||
initd_bin = getInitDFile()
|
||||
os.remove(initd_bin)
|
||||
|
||||
@@ -11,14 +11,14 @@ searchd
|
||||
{
|
||||
listen = 9312
|
||||
listen = 9306:mysql41
|
||||
log = {$SERVER_PATH}/index/searchd.log
|
||||
query_log = {$SERVER_PATH}/index/query.log
|
||||
log = {$SERVER_APP}/index/searchd.log
|
||||
query_log = {$SERVER_APP}/index/query.log
|
||||
read_timeout = 5
|
||||
max_children = 0
|
||||
pid_file = {$SERVER_PATH}/index/searchd.pid
|
||||
pid_file = {$SERVER_APP}/index/searchd.pid
|
||||
seamless_rotate = 1
|
||||
preopen_indexes = 1
|
||||
unlink_old = 1
|
||||
#workers = threads # for RT to work
|
||||
binlog_path = {$SERVER_PATH}/index/binlog/
|
||||
binlog_path = {$SERVER_APP}/index
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
<p class="bgw" onclick="pluginService('sphinx');">服务</p>
|
||||
<p onclick="pluginInitD('sphinx');">自启动</p>
|
||||
<p onclick="pluginConfig('sphinx');">配置修改</p>
|
||||
<p onclick="pluginLogs('sphinx','','run_log');">日志</p>
|
||||
<p onclick="pluginLogs('sphinx','','run_log');">运行日志</p>
|
||||
<p onclick="pluginLogs('sphinx','','query_log');">查询日志</p>
|
||||
</div>
|
||||
<div class="bt-w-con pd15">
|
||||
<div class="soft-man-con"></div>
|
||||
|
||||
+21
-4
@@ -4,7 +4,7 @@ import sys
|
||||
import io
|
||||
import os
|
||||
import time
|
||||
|
||||
import re
|
||||
sys.path.append(os.getcwd() + "/class/core")
|
||||
import public
|
||||
|
||||
@@ -67,6 +67,8 @@ def contentReplace(content):
|
||||
service_path = public.getServerDir()
|
||||
content = content.replace('{$ROOT_PATH}', public.getRootDir())
|
||||
content = content.replace('{$SERVER_PATH}', service_path)
|
||||
content = content.replace('{$SERVER_APP}', service_path + '/sphinx')
|
||||
return content
|
||||
|
||||
|
||||
def status():
|
||||
@@ -89,7 +91,7 @@ def initDreplace():
|
||||
|
||||
# initd replace
|
||||
content = public.readFile(file_tpl)
|
||||
content = content.replace('{$SERVER_PATH}', service_path)
|
||||
content = contentReplace(content)
|
||||
public.writeFile(file_bin, content)
|
||||
public.execShell('chmod +x ' + file_bin)
|
||||
|
||||
@@ -167,6 +169,21 @@ def initdUinstall():
|
||||
return 'ok'
|
||||
|
||||
|
||||
def runLog():
|
||||
path = getConf()
|
||||
content = public.readFile(path)
|
||||
rep = 'log\s*=\s*(.*)'
|
||||
tmp = re.search(rep, content)
|
||||
return tmp.groups()[0]
|
||||
|
||||
|
||||
def queryLog():
|
||||
path = getConf()
|
||||
content = public.readFile(path)
|
||||
rep = 'query_log\s*=\s*(.*)'
|
||||
tmp = re.search(rep, content)
|
||||
return tmp.groups()[0]
|
||||
|
||||
if __name__ == "__main__":
|
||||
func = sys.argv[1]
|
||||
if func == 'status':
|
||||
@@ -185,11 +202,11 @@ if __name__ == "__main__":
|
||||
print initdInstall()
|
||||
elif func == 'initd_uninstall':
|
||||
print initdUinstall()
|
||||
elif func == 'run_info':
|
||||
print runInfo()
|
||||
elif func == 'conf':
|
||||
print getConf()
|
||||
elif func == 'run_log':
|
||||
print runLog()
|
||||
elif func == 'query_log':
|
||||
print queryLog()
|
||||
else:
|
||||
print 'error'
|
||||
|
||||
Reference in New Issue
Block a user