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
5eef584c
Commit
5eef584c
authored
7 years ago
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bugfix] 解决打印print失败问题,原因在于运行docker没有tty,也可以添加PYTHONIOENCODING环境变量解决
parent
f4a39aba
master
auditor_jym
audits
dev
dev_beta
dev_beta_db
gengmei
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
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
11 additions
and
6 deletions
+11
-6
run_server.py
run_server.py
+11
-6
No files found.
run_server.py
View file @
5eef584c
...
...
@@ -7,7 +7,6 @@ import threading
import
time
import
argparse
import
sys
import
io
from
apps
import
__version__
...
...
@@ -16,6 +15,7 @@ try:
except
ImportError
:
CONFIG
=
type
(
'_'
,
(),
{
'__getattr__'
:
None
})()
os
.
environ
[
"PYTHONIOENCODING"
]
=
"UTF-8"
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
APPS_DIR
=
os
.
path
.
join
(
BASE_DIR
,
'apps'
)
...
...
@@ -86,12 +86,12 @@ def start_beat():
os
.
environ
.
setdefault
(
'C_FORCE_ROOT'
,
'1'
)
pidfile
=
'/tmp/beat.pid'
if
os
.
path
.
exists
(
pidfile
):
print
(
"Beat pid file `` exist, remove it"
.
format
(
pidfile
))
print
(
"Beat pid file `
{}
` exist, remove it"
.
format
(
pidfile
))
os
.
unlink
(
pidfile
)
time
.
sleep
(
0.5
)
if
os
.
path
.
exists
(
pidfile
):
print
(
"Beat pid file `` exist yet, may be something wrong"
.
format
(
pidfile
))
print
(
"Beat pid file `
{}
` exist yet, may be something wrong"
.
format
(
pidfile
))
os
.
unlink
(
pidfile
)
time
.
sleep
(
0.5
)
...
...
@@ -147,7 +147,12 @@ def stop_service():
os
.
unlink
(
'/tmp/beat.pid'
)
start_service
(
'all'
)
if
__name__
==
'__main__'
:
parser
=
argparse
.
ArgumentParser
(
description
=
"Jumpserver start tools"
)
parser
.
add_argument
(
"services"
,
type
=
str
,
nargs
=
'+'
,
default
=
"all"
,
choices
=
(
"all"
,
"gunicorn"
,
"celery"
,
"beat"
),
help
=
"The service to start"
,
)
args
=
parser
.
parse_args
()
start_service
(
args
.
services
)
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