Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
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
dataplatform
atlas
Commits
ad398393
Commit
ad398393
authored
Jul 11, 2017
by
Graham Wallis
Committed by
Madhan Neethiraj
Jul 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1733: updated atlas_stop.py script to work in Windows environment
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
8fe110c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
atlas_stop.py
distro/src/bin/atlas_stop.py
+22
-5
No files found.
distro/src/bin/atlas_stop.py
View file @
ad398393
...
...
@@ -15,8 +15,18 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Signal handling is OS-specific because there is no SIGKILL on Windows.
import
os
from
signal
import
SIGTERM
,
SIGKILL
if
os
.
name
==
"nt"
:
# Attempting to import SIGKILL on Windows would cause script to fail.
from
signal
import
SIGTERM
else
:
from
signal
import
SIGTERM
,
SIGKILL
import
sys
import
traceback
import
time
...
...
@@ -63,15 +73,22 @@ def main():
# stop hbase
if
mc
.
is_hbase_local
(
confdir
):
mc
.
run_hbase_action
(
mc
.
hbaseBinDir
(
atlas_home
),
"stop"
,
None
,
None
,
True
)
if
mc
.
exist_pid
(
pid
):
#after 30 seconds kill it
time
.
sleep
(
30
)
try
:
sys
.
stderr
.
write
(
"did not stop gracefully after 30 seconds seconds: killing with SIGKILL
\n
"
)
os
.
kill
(
pid
,
SIGKILL
)
if
os
.
name
==
"nt"
:
# If running on Windows then timeout termination uses SIGTERM instead of SIGKILL.
sys
.
stderr
.
write
(
"did not stop gracefully after 30 seconds: killing process using SIGTERM
\n
"
)
os
.
kill
(
pid
,
SIGTERM
)
else
:
sys
.
stderr
.
write
(
"did not stop gracefully after 30 seconds: killing process using SIGKILL
\n
"
)
os
.
kill
(
pid
,
SIGKILL
)
except
:
pass
pass
if
__name__
==
'__main__'
:
try
:
...
...
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