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
dafe71af
Unverified
Commit
dafe71af
authored
Nov 20, 2019
by
老广
Committed by
GitHub
Nov 20, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3446 from jumpserver/dev
[Update] 修改jms
parents
c5438fd6
d563a11a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
jms
jms
+11
-5
No files found.
jms
View file @
dafe71af
...
@@ -114,7 +114,7 @@ def check_pid(pid):
...
@@ -114,7 +114,7 @@ def check_pid(pid):
""" Check For the existence of a unix pid. """
""" Check For the existence of a unix pid. """
try
:
try
:
os
.
kill
(
pid
,
0
)
os
.
kill
(
pid
,
0
)
except
OSError
:
except
(
OSError
,
ProcessLookupError
)
:
return
False
return
False
else
:
else
:
return
True
return
True
...
@@ -231,6 +231,9 @@ def get_start_worker_kwargs(queue, num):
...
@@ -231,6 +231,9 @@ def get_start_worker_kwargs(queue, num):
if
os
.
getuid
()
==
0
:
if
os
.
getuid
()
==
0
:
os
.
environ
.
setdefault
(
'C_FORCE_ROOT'
,
'1'
)
os
.
environ
.
setdefault
(
'C_FORCE_ROOT'
,
'1'
)
server_hostname
=
os
.
environ
.
get
(
"SERVER_HOSTNAME"
)
if
not
server_hostname
:
server_hostname
=
'
%
h'
cmd
=
[
cmd
=
[
'celery'
,
'worker'
,
'celery'
,
'worker'
,
...
@@ -238,7 +241,7 @@ def get_start_worker_kwargs(queue, num):
...
@@ -238,7 +241,7 @@ def get_start_worker_kwargs(queue, num):
'-l'
,
'INFO'
,
'-l'
,
'INFO'
,
'-c'
,
str
(
num
),
'-c'
,
str
(
num
),
'-Q'
,
queue
,
'-Q'
,
queue
,
'-n'
,
'{}@
%
h'
.
format
(
queu
e
)
'-n'
,
'{}@
{}'
.
format
(
queue
,
server_hostnam
e
)
]
]
return
{
"cmd"
:
cmd
,
"cwd"
:
APPS_DIR
}
return
{
"cmd"
:
cmd
,
"cwd"
:
APPS_DIR
}
...
@@ -437,6 +440,12 @@ def stop_service(srv, sig=15):
...
@@ -437,6 +440,12 @@ def stop_service(srv, sig=15):
print
(
"Stop service: {}"
.
format
(
s
),
end
=
''
)
print
(
"Stop service: {}"
.
format
(
s
),
end
=
''
)
pid
=
get_pid
(
s
)
pid
=
get_pid
(
s
)
os
.
kill
(
pid
,
sig
)
os
.
kill
(
pid
,
sig
)
with
LOCK
:
process
=
processes
.
pop
(
s
,
None
)
if
process
is
None
:
print
(
"
\033
[31m No process found
\033
[0m"
)
continue
process
.
wait
(
1
)
for
i
in
range
(
STOP_TIMEOUT
):
for
i
in
range
(
STOP_TIMEOUT
):
if
i
==
STOP_TIMEOUT
-
1
:
if
i
==
STOP_TIMEOUT
-
1
:
print
(
"
\033
[31m Error
\033
[0m"
)
print
(
"
\033
[31m Error
\033
[0m"
)
...
@@ -447,9 +456,6 @@ def stop_service(srv, sig=15):
...
@@ -447,9 +456,6 @@ def stop_service(srv, sig=15):
time
.
sleep
(
1
)
time
.
sleep
(
1
)
continue
continue
with
LOCK
:
processes
.
pop
(
s
,
None
)
if
srv
==
"all"
:
if
srv
==
"all"
:
stop_daemon_service
()
stop_daemon_service
()
...
...
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