SIGTERM is one of the POSIX mandated signals; it indicates that the process should terminate, which is also the default action for SIGTERM.
Questions tagged [sigterm]
238 questions
4
votes
1 answer
PHP SIGTERM in CLI
I'm running php scripts from CLI, and i'd like to execute a function when script stopped with ctrl + c. I tried this:

Lay András
- 795
- 2
- 9
- 14
4
votes
1 answer
Why is signal.SIGTERM not dealt with properly in my main thread?
I have python code which runs continuously (collecting sensor data). It is supposed to be launched at boot using start-stop-daemon. However, I'd like to be able to kill the process gracefully, so I've started from the advice in the post How to…

Rabarberski
- 23,854
- 21
- 74
- 96
4
votes
1 answer
Java application does not receive SIGNALs on Ubuntu 12.04
Strange problem
I'm trying to shutdown my Java app properly on receiving signal, either send manually via kill.
I tried kill SIGTERM, SIGHUP, SIGINT etc. and every time JVM just stops without calling Runtime shutdown hooks, finally block or signal…

ivenhov
- 311
- 3
- 12
4
votes
1 answer
SSH forwarding signals to remote process
I'm running an ssh command as a background job:
ssh -l user server 'sleep 1000' &
Lets say that the above returns the process ID: [ssh_pid].
How can I make ssh forward signals to the remote process?
i.e. Supposing that I do: kill -TERM [ssh_pid],…

Kowshik
- 1,541
- 3
- 17
- 25
3
votes
1 answer
How to handle correctly SIGTERM in a gunicorn app?
I have a Python Flask app:
from flask import Flask, Response
import signal
app = Flask("myapp")
def exit_gracefully(*args):
print("Doing something here")
signal.signal(signal.SIGINT, exit_gracefully)
signal.signal(signal.SIGTERM,…

Ailothaen
- 61
- 7
3
votes
1 answer
Kubernetes Pod with Sleep command takes time to get deleted
Currently it takes quite a long time before the pod can be terminated after a kubectl delete command. I have the feeling that it could be because of the sleep command.
How can I make the container stop faster?
What best practices should I use…

user5580578
- 1,134
- 1
- 12
- 28
3
votes
2 answers
Handle two consequent SIGTERMs
There is a daemon which has two threads: th1, th2. th2 reads a socket using read(2).
If I kill the daemon with SIGTERM, th1 catches and handles the signal (sets the termination flag), after that the daemon destructor get called, it calls…

vissi
- 2,325
- 1
- 19
- 26
3
votes
2 answers
Deno and Docker how to listen for the SIGTERM signal and close the server
I'm trying to find a way to listen in Deno for the Docker SIGTERM signal to close my Oak server. I got this code from Oak website and it works fine when I call the controller.abort() function, using setTimeout or an end-point. However, I want to…

Icaro
- 14,585
- 6
- 60
- 75
3
votes
0 answers
QApplication and SIGTERM
Why doesn't QApplication handle SIGTERM (and any other) signal and exit gracefully? Are there any good reasons not to do it?

groaner
- 540
- 4
- 12
3
votes
1 answer
Java: How to handle a SIGTERM only?
Is there a way in Java to handle a received SIGTERM?
I am running a java service but do not want to close my java service when the user log off.
Would like to override only the sigterm shutdown handler but retain the handlers for the rest of the…

zeroin23
- 1,821
- 4
- 20
- 26
3
votes
3 answers
How to break Async series on SIGTERM?
Assume I have the following scenario -
async.series(
[
function (cbi) {
students.getAll('student', function (err, response) {
if (err) {
logger.error(err);
}
cbi(err, response);
});
},
…

JavaDeveloper
- 5,320
- 16
- 79
- 132
3
votes
3 answers
ActiveRecord::StatementInvalid when process receives SIGTERM?
In my Rails app, I have a script that updates some records in the database. When I send a SIGTERM to kill the script, it occasionally receives that signal while ActiveRecord is executing a query. This leads to an ActiveRecord::StatementInvalid…

readonly
- 343,444
- 107
- 203
- 205
3
votes
1 answer
Can R interpret a SIGINT/SIGTERM and execute a process as a result?
Is there anyway to capture a SIGINT or SIGTERM from the shell in R so that I can try to execute some graceful exit code?
So far, I haven't found anything in my search.

Shuo
- 491
- 1
- 6
- 16
3
votes
3 answers
Thread1: signal SIGTERM (in swift) when changing hardware in IOS simulator
My swift application is set for certain IOS device, and runs fine in IOS simulator,
However, when changing hardware in IOS simulator, I get the error in swift Thread1: signal SIGTERM.
I can set swift for IOS device iPhone 6, IOS simulator runs…

ReneMusters
- 229
- 1
- 3
- 10
3
votes
1 answer
Docker stop exit code -1 if the default CMD is a shell script
I am building a tomcat container in Docker with supervisord. If the default command in the Dockerfile is
CMD supervisord -c /etc/supervisord.conf
and when i dispatch docker stop command, the container exits successfully with the exit code 0.
But…

cucucool
- 3,777
- 8
- 48
- 63