mirror of https://github.com/jumpserver/jumpserver
pref: 添加命令启动失败 debug
parent
045bc3661a
commit
2705c38ba1
|
@ -44,7 +44,9 @@ class BaseService(object):
|
||||||
if self.is_running:
|
if self.is_running:
|
||||||
msg = f'{self.name} is running: {self.pid}.'
|
msg = f'{self.name} is running: {self.pid}.'
|
||||||
else:
|
else:
|
||||||
msg = f'{self.name} is stopped.'
|
msg = '\033[31m{} is stopped.\033[0m\nYou can manual start it to find the error: \n' \
|
||||||
|
' $ cd {}\n' \
|
||||||
|
' $ {}'.format(self.name, self.cwd, ' '.join(self.cmd))
|
||||||
print(msg)
|
print(msg)
|
||||||
|
|
||||||
# -- log --
|
# -- log --
|
||||||
|
|
|
@ -76,7 +76,6 @@ class ServicesUtil(object):
|
||||||
def clean_up(self):
|
def clean_up(self):
|
||||||
if not self.EXIT_EVENT.is_set():
|
if not self.EXIT_EVENT.is_set():
|
||||||
self.EXIT_EVENT.set()
|
self.EXIT_EVENT.set()
|
||||||
|
|
||||||
self.stop()
|
self.stop()
|
||||||
|
|
||||||
def show_status(self):
|
def show_status(self):
|
||||||
|
|
|
@ -332,7 +332,6 @@ class HealthCheckView(HealthApiMixin):
|
||||||
return False, str(e)
|
return False, str(e)
|
||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
start = time.time()
|
|
||||||
redis_status, redis_time = self.get_redis_status()
|
redis_status, redis_time = self.get_redis_status()
|
||||||
db_status, db_time = self.get_db_status()
|
db_status, db_time = self.get_db_status()
|
||||||
status = all([redis_status, db_status])
|
status = all([redis_status, db_status])
|
||||||
|
|
|
@ -59,7 +59,6 @@ class BaseTerminal(object):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
status = status_serializer.save()
|
status = status_serializer.save()
|
||||||
print("Save status ok: ", status)
|
|
||||||
time.sleep(self.interval)
|
time.sleep(self.interval)
|
||||||
except OperationalError:
|
except OperationalError:
|
||||||
print("Save status error, close old connections")
|
print("Save status error, close old connections")
|
||||||
|
|
Loading…
Reference in New Issue