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
d563a11a
Commit
d563a11a
authored
Nov 20, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改jms
parent
61a8d6a5
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 @
d563a11a
...
...
@@ -114,7 +114,7 @@ def check_pid(pid):
""" Check For the existence of a unix pid. """
try
:
os
.
kill
(
pid
,
0
)
except
OSError
:
except
(
OSError
,
ProcessLookupError
)
:
return
False
else
:
return
True
...
...
@@ -231,6 +231,9 @@ def get_start_worker_kwargs(queue, num):
if
os
.
getuid
()
==
0
:
os
.
environ
.
setdefault
(
'C_FORCE_ROOT'
,
'1'
)
server_hostname
=
os
.
environ
.
get
(
"SERVER_HOSTNAME"
)
if
not
server_hostname
:
server_hostname
=
'
%
h'
cmd
=
[
'celery'
,
'worker'
,
...
...
@@ -238,7 +241,7 @@ def get_start_worker_kwargs(queue, num):
'-l'
,
'INFO'
,
'-c'
,
str
(
num
),
'-Q'
,
queue
,
'-n'
,
'{}@
%
h'
.
format
(
queu
e
)
'-n'
,
'{}@
{}'
.
format
(
queue
,
server_hostnam
e
)
]
return
{
"cmd"
:
cmd
,
"cwd"
:
APPS_DIR
}
...
...
@@ -437,6 +440,12 @@ def stop_service(srv, sig=15):
print
(
"Stop service: {}"
.
format
(
s
),
end
=
''
)
pid
=
get_pid
(
s
)
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
):
if
i
==
STOP_TIMEOUT
-
1
:
print
(
"
\033
[31m Error
\033
[0m"
)
...
...
@@ -447,9 +456,6 @@ def stop_service(srv, sig=15):
time
.
sleep
(
1
)
continue
with
LOCK
:
processes
.
pop
(
s
,
None
)
if
srv
==
"all"
:
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