独立项目的tomcat启动 @author lkq 2021-08-27 @param get.domain 项目域名 @param get.type 启动类型 start stop reload
(self, get)
| 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 | ''' |
no test coverage detected