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
4c002afd
Commit
4c002afd
authored
Dec 18, 2015
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix install bug
parent
caa0e295
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
15 deletions
+14
-15
next.py
install/next.py
+8
-1
service.sh
service.sh
+6
-14
No files found.
install/next.py
View file @
4c002afd
...
...
@@ -47,18 +47,25 @@ class Setup(object):
def
_create_admin
(
self
):
db_add_user
(
username
=
self
.
admin_user
,
password
=
self
.
admin_pass
,
role
=
'SU'
,
name
=
'admin'
,
groups
=
''
,
admin_groups
=
''
,
email
=
'admin@jumpserver.org'
,
uuid
=
'MayBeYouAreTheFirstUser'
,
is_active
=
True
)
os
.
system
(
'
useradd
%
s'
%
self
.
admin_user
)
os
.
system
(
'
id
%
s || useradd
%
s'
%
(
self
.
admin_user
,
self
.
admin_user
)
)
@staticmethod
def
_cp_zzsh
():
os
.
chdir
(
jms_dir
)
shutil
.
copy
(
'zzjumpserver.sh'
,
'/etc/profile.d/'
)
@staticmethod
def
_run_service
():
os
.
system
(
'sh
%
s start'
%
os
.
path
.
join
(
jms_dir
,
'service.sh'
))
color_print
(
'安装成功,请访问web .'
)
def
start
(
self
):
print
"开始安装Jumpserver, 要求环境为 CentOS 6.5 x86_64"
self
.
_sync_db
()
self
.
_input_admin
()
self
.
_create_admin
()
self
.
_cp_zzsh
()
self
.
_run_service
()
if
__name__
==
'__main__'
:
...
...
service.sh
View file @
4c002afd
...
...
@@ -7,7 +7,7 @@
# Date: 2015-04-12
# Version: 2.0.0
# Site: http://www.jumpserver.org
# Author:
jumpserver group
# Author:
Jumpserver Team
.
/etc/init.d/functions
export
PATH
=
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/node/bin
...
...
@@ -26,17 +26,16 @@ start() {
success
"
$jump_start
"
else
daemon python
$base_dir
/manage.py runserver 0.0.0.0:80 &>> /tmp/jumpserver.log 2>&1 &
daemon python
$base_dir
/log_handler.py &> /dev/null 2>&1 &
cd
$base_dir
/websocket/
;
daemon node index.js &> /dev/null 2>&1 &
daemon python
$base_dir
/run_websocket.py &> /dev/null 2>&1 &
sleep
2
echo
-n
"
$jump_start
"
nums
=
0
for
i
in
manage.py
log_handler.py index.js
;
do
ps aux |
grep
"
$i
"
|
grep
-v
'grep'
&> /dev/null
&&
let
nums+
=
1
for
i
in
manage.py
run_websocket.py
;
do
ps aux |
grep
"
$i
"
|
grep
-v
'grep'
&> /dev/null
&&
let
nums+
=
1
||
echo
"
$i
not running"
done
if
[
"x
$nums
"
==
"x
3
"
]
;
then
if
[
"x
$nums
"
==
"x
2
"
]
;
then
success
"
$jump_start
"
touch
"
$lockfile
"
echo
...
...
@@ -44,7 +43,6 @@ start() {
failure
"
$jump_start
"
echo
fi
fi
...
...
@@ -56,7 +54,7 @@ stop() {
echo
-n
$"Stopping
${
PROC_NAME
}
service:"
if
[
-e
$lockfile
]
;
then
ps aux |
grep
-E
'manage.py|
log_handler.py|index.js
'
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
-9
&> /dev/null
ps aux |
grep
-E
'manage.py|
run_websocket.py
'
|
grep
-v
grep
|
awk
'{print $2}'
| xargs
kill
-9
&> /dev/null
ret
=
$?
if
[
$ret
-eq
0
]
;
then
...
...
@@ -104,9 +102,3 @@ esac
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