mirror of https://github.com/jumpserver/jumpserver
				
				
				
			fix (install.py): compatable centos7
1. use systemctl stop firewalld 2. add dependence: readline-devel and lrzszpull/98/head
							parent
							
								
									cac94245ea
								
							
						
					
					
						commit
						b80ad40f54
					
				|  | @ -88,6 +88,13 @@ class PreSetup(object): | ||||||
|         if self.dist == "centos" or self.dist == "redhat" or self.dist == "fedora": |         if self.dist == "centos" or self.dist == "redhat" or self.dist == "fedora": | ||||||
|             return True |             return True | ||||||
| 
 | 
 | ||||||
|  |     @property | ||||||
|  |     def _is_centos7(self): | ||||||
|  |         version = platform.dist()[1] | ||||||
|  |         if self._is_redhat: | ||||||
|  |             if version.startswith("7"): | ||||||
|  |                 return True | ||||||
|  | 
 | ||||||
|     @property |     @property | ||||||
|     def _is_ubuntu(self): |     def _is_ubuntu(self): | ||||||
|         if self.dist == "ubuntu" or self.dist == "debian": |         if self.dist == "ubuntu" or self.dist == "debian": | ||||||
|  | @ -146,10 +153,17 @@ class PreSetup(object): | ||||||
|         color_print('开始关闭防火墙和selinux', 'green') |         color_print('开始关闭防火墙和selinux', 'green') | ||||||
|         if self._is_redhat: |         if self._is_redhat: | ||||||
|             os.system("export LANG='en_US.UTF-8' && sed -i 's/LANG=.*/LANG=en_US.UTF-8/g' /etc/sysconfig/i18n") |             os.system("export LANG='en_US.UTF-8' && sed -i 's/LANG=.*/LANG=en_US.UTF-8/g' /etc/sysconfig/i18n") | ||||||
|  |             if self._is_centos7: | ||||||
|  |                 cmd1 = "systemctl status firewalld 2> /dev/null 1> /dev/null" | ||||||
|  |                 cmd2 = "systemctl stop firewalld" | ||||||
|  |                 cmd3 = "systemctl disable firewalld" | ||||||
|  |                 bash('%s && %s && %s' % (cmd1, cmd2, cmd3)) | ||||||
|  |                 bash('setenforce 0') | ||||||
|  |             else: | ||||||
|                 bash('service iptables stop && chkconfig iptables off && setenforce 0') |                 bash('service iptables stop && chkconfig iptables off && setenforce 0') | ||||||
|         if self._is_ubuntu: |         if self._is_ubuntu: | ||||||
|             os.system("export LANG='en_US.UTF-8'") |             os.system("export LANG='en_US.UTF-8'") | ||||||
|             bash("iptables -F") |             bash("which iptables && iptables -F") | ||||||
|             bash('which selinux && setenforce 0') |             bash('which selinux && setenforce 0') | ||||||
| 
 | 
 | ||||||
|     def _test_db_conn(self): |     def _test_db_conn(self): | ||||||
|  | @ -189,9 +203,9 @@ class PreSetup(object): | ||||||
|     def _depend_rpm(self): |     def _depend_rpm(self): | ||||||
|         color_print('开始安装依赖包', 'green') |         color_print('开始安装依赖包', 'green') | ||||||
|         if self._is_redhat: |         if self._is_redhat: | ||||||
|             bash('yum -y install git python-pip mysql-devel gcc automake autoconf python-devel vim sshpass') |             bash('yum -y install git python-pip mysql-devel gcc automake autoconf python-devel vim sshpass lrzsz readline-devel') | ||||||
|         if self._is_ubuntu: |         if self._is_ubuntu: | ||||||
|             bash("apt-get -y --force-yes install git python-pip gcc automake autoconf vim sshpass libmysqld-dev python-all-dev") |             bash("apt-get -y --force-yes install git python-pip gcc automake autoconf vim sshpass libmysqld-dev python-all-dev lrzsz libreadline-dev") | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|     @staticmethod |     @staticmethod | ||||||
|  |  | ||||||
|  | @ -99,7 +99,7 @@ class Setup(object): | ||||||
|         color_print('安装成功,请访问web, 祝你使用愉快。\n请访问 https://github.com/jumpserver/jumpserver 查看文档', 'green') |         color_print('安装成功,请访问web, 祝你使用愉快。\n请访问 https://github.com/jumpserver/jumpserver 查看文档', 'green') | ||||||
| 
 | 
 | ||||||
|     def start(self): |     def start(self): | ||||||
|         print "开始安装Jumpserver, 要求环境为 CentOS 6.5 x86_64" |         print "开始安装Jumpserver ..." | ||||||
|         self._pull() |         self._pull() | ||||||
|         self._sync_db() |         self._sync_db() | ||||||
|         self._input_admin() |         self._input_admin() | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 yumaojun
						yumaojun