This commit is contained in:
Mr Chen
2019-01-16 14:56:26 +08:00
parent 0b55595ce6
commit 9169ce58de
3 changed files with 28 additions and 8 deletions
+1 -1
View File
@@ -20,5 +20,5 @@ searchd
preopen_indexes = 1
unlink_old = 1
#workers = threads # for RT to work
binlog_path = {$SERVER_APP}/index
binlog_path = {$SERVER_APP}/index/binlog
}
+26 -6
View File
@@ -79,6 +79,15 @@ def status():
return 'start'
def mkdirAll():
content = public.readFile(getConf())
rep = 'path\s*=\s*(.*)'
p = re.compile(rep)
tmp = p.findall(content)
for x in tmp:
public.execShell('mkdir -p ' + x)
def initDreplace():
file_tpl = getInitDTpl()
@@ -102,31 +111,32 @@ def initDreplace():
conf_content = contentReplace(conf_content)
public.writeFile(getServerDir() + '/sphinx.conf', conf_content)
mkdirAll()
return file_bin
def start():
file = initDreplace()
data = public.execShell(file + ' start')
if data[0] == '':
if data[1] == '':
return 'ok'
return data[0]
return data[1]
def stop():
file = initDreplace()
data = public.execShell(file + ' stop')
if data[0] == '':
if data[1] == '':
return 'ok'
return data[0]
return data[1]
def restart():
file = initDreplace()
data = public.execShell(file + ' restart')
if data[0] == '':
if data[1] == '':
return 'ok'
return data[0]
return data[1]
def reload():
@@ -137,6 +147,14 @@ def reload():
return 'fail'
def rebuild():
file = initDreplace()
data = public.execShell(file + ' rebuild')
if data[1] == '':
return 'ok'
return 'fail'
def initdStatus():
if not app_debug:
if public.isAppleSystem():
@@ -196,6 +214,8 @@ if __name__ == "__main__":
print restart()
elif func == 'reload':
print reload()
elif func == 'rebuild':
print rebuild()
elif func == 'initd_status':
print initdStatus()
elif func == 'initd_install':
+1 -1
View File
@@ -33,7 +33,7 @@ start () {
}
rebuild () {
${APP_PATH}/bin/bin/indexer -c ${APP_CONF} --all --rotate
${APP_PATH}/bin/bin/indexer -c ${APP_CONF} --all --rotate &
}