Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
d4b57fc1
Commit
d4b57fc1
authored
9 years ago
by
yumaojun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix (install.py): ubuntu auto install mysql-server
1. auto install mysql server
parent
d63b5772
master
auditor_jym
audits
dev
dev_beta
dev_beta_db
gengmei
lagacy-0.4.0
node_service
password
rbac
restrict_access
test
v52
wph
1.5.2
1.5.1
1.5.0
1.4.10
1.4.9
1.4.8
1.4.7
1.4.6
1.4.5
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.3
1.3.2
1.3.1
1.3.0
1.2.1
1.2.0
1.1.1
1.1.0
1.0.0
0.3.3
0.3.2
0.3.2-rc2
0.3.1
v1.4.10
v1.4.7
v1.4.4
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
install.py
install/install.py
+7
-5
No files found.
install/install.py
View file @
d4b57fc1
...
...
@@ -94,8 +94,9 @@ class PreSetup(object):
return
True
def
check_platform
(
self
):
if
self
.
_is_redhat
or
self
.
_is_ubuntu
:
raise
ValueError
(
u"支持的平台: CentOS, RedHat, Fedora, Debian, Ubuntu, 暂不支持其他平台安装."
)
if
not
(
self
.
_is_redhat
or
self
.
_is_ubuntu
):
print
(
u"支持的平台: CentOS, RedHat, Fedora, Debian, Ubuntu, 暂不支持其他平台安装."
)
exit
()
def
write_conf
(
self
,
conf_file
=
os
.
path
.
join
(
jms_dir
,
'jumpserver.conf'
)):
color_print
(
'开始写入配置文件'
,
'green'
)
...
...
@@ -130,9 +131,10 @@ class PreSetup(object):
self
.
db_host
,
self
.
db_pass
))
if
self
.
_is_ubuntu
:
bash
(
'echo mysql-server mysql-server/root_password select '' | debconf-set-selections'
)
bash
(
'echo mysql-server mysql-server/root_password_again select '' | debconf-set-selections'
)
bash
(
'apt-get -y install mysql-server'
)
cmd1
=
'echo mysql-server mysql-server/root_password select '' | debconf-set-selections'
cmd2
=
'echo mysql-server mysql-server/root_password_again select '' | debconf-set-selections'
cmd3
=
'apt-get -y install mysql-server'
bash
(
'
%
s;
%
s;
%
s'
%
(
cmd1
,
cmd2
,
cmd3
))
bash
(
'service mysql start'
)
bash
(
'mysql -e "create database
%
s default charset=utf8"'
%
self
.
db
)
bash
(
'mysql -e "grant all on
%
s.* to
\'
%
s
\'
@
\'
%
s
\'
identified by
\'
%
s
\'
"'
%
(
self
.
db
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment