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
2
votes
0 answers
Killing foreman child processes via runit
I'm using runit for process supervision. I have the following simple run script for a service:
#!/bin/sh -e
cd /opt/myapp
exec 2>&1
exec chpst -u ubuntu /home/ubuntu/.rvm/bin/myapp_foreman start -t 1 -c web=1,worker=1
This starts foreman wrapped…

Gordon Seidoh Worley
- 7,839
- 6
- 45
- 82
2
votes
3 answers
handling sigterm in OSx
I have console C++ application built in XCode 6 and want to add SIGTERM handler to it. There are a lot of examples, but I can't get them to work.
#include
namespace
{
volatile std::sig_atomic_t gDone = 0;
}
static void term_handler(int…

Sergi0
- 1,084
- 14
- 28
2
votes
2 answers
Logging a message from SIGTERM
What's the proper way to log a shutdown message when an application (a C++ daemon, in my case) receives a SIGTERM or SIGINT?
According to CERT and the signal(7) manpage, many functions (including, presumably, those used by most logging libraries)…

Josh Kelley
- 56,064
- 19
- 146
- 246
1
vote
1 answer
My iPhone Simulator gets SIGTERM when I quit it after clicking Home button
My iPhone Simulator always gets SIGTERM signal when I quit it after clicking Home button. No matter what app I run, even the template app generated by XCode, as long as I first click Home button then quit Simulator, I will get SIGTERM signal in…

Qiulang
- 10,295
- 11
- 80
- 129
1
vote
2 answers
How did the system($command) call return a 0 exit code even though the command was still running?
The following perl code was running through a Python script.
my $pid = fork;
my @pids;
if ($pid) {
push(@pids, $pid);
$return_code = system($command);
}
foreach my $pid (@pids) {
waitpid($pid, 0);
}
$return_code = $return_code >>…

tourist
- 506
- 1
- 6
- 20
1
vote
2 answers
Flutter exit callback handler in all cases cross-platform
I am looking for a way to dispose some final things before my application closes. I want this to happen on web close, on native window close and on mobile close.
I thought I'd do it like this, but the flutter engines takes my widgets and ends the…

Marnix
- 6,384
- 4
- 43
- 78
1
vote
0 answers
how to handle sigterm signal in .net 6 app deployed in azure kubernetes service
I have a .NET 6 application. This application contains a BackgroundService that is used to handler background jobs. These jobs are fired on a certain time based on different schedules.
I need to implement graceful shutdown when the application is…

Ghyath Serhal
- 7,466
- 6
- 44
- 60
1
vote
0 answers
Set exit code when receiving SIGTERM in Quarkus
I’d like to know how I can tell Quarkus to gracefully exit with code 0 upon receiving SIGTERM. I’d still like to react differently (i.e. with an “error” exit code, meaning any number strictly greater than 0) to other exit conditions (such as…

Olivier Cailloux
- 977
- 9
- 24
1
vote
1 answer
Python script is stopped due to "Terminated" in linux
I need to run python script 24/7 in screen .
But my script got "terminated" and stopped.
I don't know why my script is stopped and show only "Terminated" message without getting any error message.
Therefore I run strace -p 253141 in another screen.…

Susan
- 431
- 1
- 4
- 16
1
vote
0 answers
Graceful shutdown of asynchronous processes running in java on tomcat
When sending SIGTERM to tomcat on Amazon ECS, is it possible to kill the process (so called graceful shutdown) waiting for the asynchronous process to terminate?
By setting unloadDelay in tomcat configuration (server.xml), it is possible to suspend…

skmq0106
- 31
- 1
1
vote
0 answers
How to define specific order of actions for SIGTERM signal in Fast-API
I need to code a microservice on Fast-Api which communicates with Redis and other services. If it gets SIGTERM signal, it has to work for 15s more (GET\PUT handlers) and after that shutdown gracefully.
Here is my example
from fastapi import…

Yuriy Gerasimov
- 43
- 5
1
vote
1 answer
SIGTERM Airflow
I get a "SIGTERM" error when I trigger the DAG below. I did it more than 20 times manually, and everytime the SIGTERM error comes up at different points in time. Any suggestion on what to change to make it work?
The error:
{local_task_job.py:211}…

MM Roller
- 29
- 4
1
vote
0 answers
Ignore linux process signals such as SIGTERM using sigaction from .NET app
I am not really familiar with .NET interop. Am trying to implement the ignoring of linux process signals in .NET, using a call to sigaction.
The interop definitions I could come up with are as follows:
public delegate void __sighandler_t(int…

Veverke
- 9,208
- 4
- 51
- 95
1
vote
0 answers
CTRL-C inside a container not recognized
From 1 week ago, more or less, I've a problem with every docker container. Every time that I run something inside I cannot run CTRL-C to kill that task (ex. cargo watch for Rust, iex -S mix for Elxir...). The first time the signal is not recognized,…

Visel
- 11
- 1
1
vote
1 answer
Node.js child process shutdown delay
I have a node.js process that kicks off a child process (via spawn). When the main process receives a request to shutdown (e.g. SIGTERM) it has to perform some clean-up before the process exits - this can take a few seconds. This clean-up relies on…

Neil
- 11
- 1