MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / pendent_tomcat_start

Method pendent_tomcat_start

class/projectModel/javaModel.py:962–997  ·  view source on GitHub ↗

独立项目的tomcat启动 @author lkq 2021-08-27 @param get.domain 项目域名 @param get.type 启动类型 start stop reload

(self, get)

Source from the content-addressed store, hash-verified

960 return public.returnMsg(False, '类型错误')
961
962 def pendent_tomcat_start(self, get):
963 '''
964 独立项目的tomcat启动
965 @author lkq 2021-08-27
966 @param get.domain 项目域名
967 @param get.type 启动类型 start stop reload
968 '''
969 version = get.domain
970 s_type = get.type
971 # 判断服务是否正常
972 execStr = '%s/%s/bin/daemon.sh stop && %s/%s/bin/daemon.sh start' % (
973 self.__site_path, version, self.__site_path, version)
974 start = '%s/%s/bin/daemon.sh start' % (self.__site_path, version)
975 stop = '%s/%s/bin/daemon.sh stop' % (self.__site_path, version)
976 if s_type == 'start':
977 ret = self.get_server(version, version)
978 if not ret:
979 pid_path = '%s/%s/logs/catalina-daemon.pid' % (self.__site_path, version)
980 if os.path.exists(pid_path):
981 os.remove(pid_path)
982 public.ExecShell(start)
983 self.start_by_user(self.__site_path + "/" + version)
984 return public.returnMsg(True, '启动成功')
985 elif s_type == 'stop':
986 public.ExecShell(stop)
987 if self.get_server(version, version):
988 public.ExecShell(stop)
989 self.stop_by_user(self.__site_path + "/" + version)
990 return public.returnMsg(True, '关闭成功')
991 elif s_type == 'reload' or s_type == 'restart':
992 # public.ExecShell(execStr)
993 public.ExecShell(stop)
994 public.ExecShell(start)
995 return public.returnMsg(True, '重载成功')
996 else:
997 return public.returnMsg(False, '类型错误')
998
999 def pendent_tomcat_info(self, get=None, domain=None):
1000 '''

Callers 6

set_tomcat_duli_portMethod · 0.95
stop_projectMethod · 0.95
start_projectMethod · 0.95
remove_projectMethod · 0.95
_multi_remove_duliMethod · 0.95
multi_set_projectMethod · 0.95

Calls 7

get_serverMethod · 0.95
ExecShellMethod · 0.80
returnMsgMethod · 0.80
existsMethod · 0.45
removeMethod · 0.45
start_by_userMethod · 0.45
stop_by_userMethod · 0.45

Tested by

no test coverage detected