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

Method start_tomcat

class/projectModel/javaModel.py:930–960  ·  view source on GitHub ↗
(self, get)

Source from the content-addressed store, hash-verified

928
929 # Tomcat服务管理
930 def start_tomcat(self, get):
931 version = str(get.version)
932 s_type = get.type
933 if version.startswith('tomcat') or version.startswith('Tomcat'):
934 version = version.replace('tomcat', '').replace('Tomcat', '')
935 # 判断服务是否正常
936 execStr = '/etc/init.d/bttomcat%s stop && /etc/init.d/bttomcat%s start' % (version, version)
937 start = '/usr/local/bttomcat/tomcat%s/bin/daemon.sh start' % version
938 stop = '/usr/local/bttomcat/tomcat%s/bin/daemon.sh stop' % version
939 if s_type == 'start':
940 ret = self.get_server(version)
941 if not ret:
942 pid_path = '/www/server/%s/logs/catalina-daemon.pid' % version
943 if os.path.exists(pid_path):
944 os.remove(pid_path)
945 public.ExecShell(start)
946 self.start_by_user("/etc/init.d/bttomcat{}".format(version))
947 return public.returnMsg(True, '启动成功')
948 elif s_type == 'stop':
949 public.ExecShell(stop)
950 if self.get_server(version):
951 public.ExecShell(stop)
952 self.stop_by_user("/etc/init.d/bttomcat{}".format(version))
953 return public.returnMsg(True, '关闭成功')
954 elif s_type == 'reload' or s_type == 'restart':
955 # public.ExecShell(execStr)
956 public.ExecShell(stop)
957 public.ExecShell(start)
958 return public.returnMsg(True, '重载成功')
959 else:
960 return public.returnMsg(False, '类型错误')
961
962 def pendent_tomcat_start(self, get):
963 '''

Callers 8

set_tomcat_duli_portMethod · 0.95
tomcat_vhost_deleteMethod · 0.95
replce_tomcat_portMethod · 0.95
stop_projectMethod · 0.95
start_projectMethod · 0.95
_multi_remove_neizhiMethod · 0.95
multi_set_projectMethod · 0.95

Calls 9

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

Tested by

no test coverage detected