Skip to content

Commit

Permalink
send signal to kill process
Browse files Browse the repository at this point in the history
  • Loading branch information
iliakur committed Oct 18, 2024
1 parent 102d9a3 commit 6e200d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion datadog_checks_dev/datadog_checks/dev/ssh_tunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from __future__ import absolute_import

import os
import signal
import subprocess
from contextlib import contextmanager

Expand Down Expand Up @@ -139,5 +140,5 @@ def __call__(self):
with TempDir(self.temp_name) as temp_dir:
with open(os.path.join(temp_dir, self.pid_file)) as pid_file:
pid = int(pid_file.read())
os.kill(pid)
os.kill(pid, signal.SIGKILL if os.name == 'posix' else signal.SIGTERM)
return 0

0 comments on commit 6e200d4

Please sign in to comment.