Commit 87d5b6c4 authored by ibuler's avatar ibuler

[Update] 修改启动脚本

parent 6b377ec5
...@@ -100,7 +100,7 @@ def collect_static(): ...@@ -100,7 +100,7 @@ def collect_static():
os.chdir(os.path.join(BASE_DIR, 'apps')) os.chdir(os.path.join(BASE_DIR, 'apps'))
command = 'python3 manage.py collectstatic --no-input -c &> /dev/null ' command = 'python3 manage.py collectstatic --no-input -c &> /dev/null '
subprocess.call(command, shell=True) subprocess.call(command, shell=True)
logging.info("Collect static file done") logging.info("Collect static files done")
def prepare(): def prepare():
...@@ -292,11 +292,12 @@ def watch_services(): ...@@ -292,11 +292,12 @@ def watch_services():
p.wait(timeout=1) p.wait(timeout=1)
except subprocess.TimeoutExpired: except subprocess.TimeoutExpired:
pass pass
if p.returncode is not None: ok = is_running(s)
if not ok:
stopped_services[s] = '' stopped_services[s] = ''
print("stopped") print("stopped with code: {}({})".format(p.returncode, p.pid))
else: else:
print("running") print("running at {}".format(p.pid))
stopped_services.pop(s, None) stopped_services.pop(s, None)
services_retry.pop(s, None) services_retry.pop(s, None)
...@@ -320,7 +321,10 @@ def watch_services(): ...@@ -320,7 +321,10 @@ def watch_services():
if tm != '23:59': if tm != '23:59':
return return
suffix = now.strftime('%Y-%m-%d') suffix = now.strftime('%Y-%m-%d')
for s in processes: services = list(processes.keys())
services.append('jms')
for s in services:
log_path = get_log_file_path(s) log_path = get_log_file_path(s)
log_dir = os.path.dirname(log_path) log_dir = os.path.dirname(log_path)
filename = os.path.basename(log_path) filename = os.path.basename(log_path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment