Questions tagged [sigterm]

SIGTERM is one of the POSIX mandated signals; it indicates that the process should terminate, which is also the default action for SIGTERM.

238 questions
1
vote
1 answer

After SIGTERM event: the process keep receiving requests

I have created a minimal express POC having only one base route sending hello world after 30s, using setTimeout. I sent an HTTP request and started to wait. Meanwhile I tracked the PID of the node and killed it from the terminal. The SIGTERM event…
Raz Buchnik
  • 7,753
  • 14
  • 53
  • 96
1
vote
0 answers

Why sending 'kill -15' from command line works every time but from python script only sometimes?

I'm starting a program from python script using subprocess.Popen: cmd = "exec sudo timeout 120 /opt/something/my_program" self.process = subprocess.Popen(cmd, shell=True) As a result I get three processes, eg.: 24144 pts/0 S+ 0:00 sudo…
pykaczka
  • 29
  • 5
1
vote
1 answer

Gdb inside container gets terminated with 137

When I run gdb on my binary inside kubernetes pod in container it starts loading symbol after that it suddenly gets terminated with SIGTERM and exit code 137. I checked for describe pod it shows reason Error. I have added ptrace capabilities in…
1
vote
0 answers

signal.signal not working with threading, or another Why can't I use Ctrl-C to stop my Multi-threaded Python code?

I have been banging my head against this all Labor Day long weekend. The code below does not stop with Ctrl-C. I must be doing something brain dead and can't see it anymore. Not only does it not stop, but I never get the signal handler…
1
vote
1 answer

JUnit @After not executing when Jenkins pipeline is stopped

I'm working with a declarative Jenkins pipeline that runs some tests which make use of JUnit 4. In the tests there are @After methods where test cleanup occurs. When a pipeline is aborted during a test I've confirmed that the @After methods are…
ChristianF
  • 1,735
  • 4
  • 28
  • 56
1
vote
1 answer

How can I let rack execute code on exit (sigterm)? Startet with rackup

I start with rackup --host 0.0.0.0 -p 80, my config.ru file contains the following: require_relative 'app/config/initializer' run Manager.freeze.app # What I need, but does not work. at_exit do Manager.stop_all_services end at_exit does not…
1
vote
1 answer

How to process SIGTERM gracefully in R?

In Python, one can process SIGTERM using an answer like the one here: How to process SIGTERM signal gracefully?. How can we do the same thing in R?
Alpha Bravo
  • 170
  • 12
1
vote
0 answers

Connection pool shut down error while doing graceful shutdown in spring boot

We are using spring boot version "2.3.0.M4" and have set the following parameter "server.shutdown.grace-period=30s". However when we do graceful shutdown(SIGTERM) our endpoint in the end publishes an event and the event listener publishes a message…
Sarah
  • 31
  • 2
1
vote
0 answers

AWS s3 sync keeps failing on SIGTERM trap

I run my script with timeout command which sends a SIGTERM after reaching the timeout limit. This is for testing when s3 sync command starts, hence the 30s timeout. My goal is for aws s3 sync command to gracefully finish current upload, and only…
alexfvolk
  • 1,810
  • 4
  • 20
  • 40
1
vote
0 answers

How to send sigterm to process running python through system call

I am trying to kill a process that I have forked off for the purpose of running a python script that I have installed. This script can be killed via crtl-c when running in the codeblocks terminal and when being run from the command line (bash). I…
user4243325
1
vote
1 answer

receive SIGTERM

I have designed a message passing interface in c which is used to provide communication between different processes running in my system. This interface creates 10-12 threads for its purpose and use TCP sockets to provide communication. It is…
honey
  • 11
  • 1
  • 2
1
vote
1 answer

Catching SIGTERM in C with more processes

I need that my program terminate properly all of its processes by catching SIGTERM signal, but even a CTRL+C (that is SIGINT i think). How can I modify it to make it works? I tried to post only the code necessary to don't create confusion as the…
1
vote
1 answer

How to have Linux wait till my program finishes its SIGTERM action?

How to have Linux wait till my C++ program completes its cleanup routine. The program initially calls function sigaction(2) to register a custom SIGTERM handler. If test the handler by running kill -s TERM $(ps -C a.out -o pid=), it would have no…
Cody
  • 609
  • 4
  • 21
1
vote
1 answer

database call interupted even with signal handler

I have a script that loops infinitely and makes an Oracle call through cx_oracle every X seconds. I also have a signal handler which should allow the script to exit gracefully after it finishes running the oracle procedure. The problem I am…
Mocking
  • 1,764
  • 2
  • 20
  • 36
1
vote
2 answers

Multiprocessing subprocesses randomly receive SIGTERMs

I'm fiddling with multiprocessing and signal. I'm creating a pool, and have the workers catch SIGTERMs. With no apparent reasons, I observe that the subprocesses randomly receive SIGTERMs. Here is a MWE: import multiprocessing as mp import…
Right leg
  • 16,080
  • 7
  • 48
  • 81