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
5
votes
1 answer

Uvicorn won't quit with CTRL+C

I have a Python FastAPI app that is using uvicorn. I have it packaged in docker container. When I run the app (in Power Shell on my Windows 10 machine) with a command like this: docker run -p 8080:8080 my-image-name I get the following uvicorn…
Jed
  • 1,823
  • 4
  • 20
  • 52
5
votes
1 answer

Thin doesn't respond to SIGINT or SIGTERM

bundle exec thin start -p 3111 gives the following output: Using rack adapter Thin web server (v1.2.11 codename Bat-Shit Crazy) Maximum connections set to 1024 Listening on 0.0.0.0:3111, CTRL+C to stop ^C Ctrl-C doesn't do…
Michiel de Mare
  • 41,982
  • 29
  • 103
  • 134
5
votes
1 answer

Unable to trap signals in docker entrypoint script

I have a docker entrypoint script that is supposed to trap signals sent to processes in the container. The main application is tomcat - java process embedded in the docker-entrypoint.sh which is passed to dumb-init. The process mapping in the…
IPlato
  • 191
  • 2
  • 7
5
votes
1 answer

Automatic Pod Deletion Delay in Kubernetes

Is there is a way to automatically delay all Kubernetes pod deletion requests such that the endpoint deregistration is signaled, but the pod's SIGTERM is delayed by several seconds? It would be preferable, but not required, if the delay only…
Eldstone
  • 51
  • 1
  • 3
5
votes
1 answer

npm run poststop script on ctrl+c

My package.json scripts section looks like this. "scripts": { "prestart": "mongod", "start": "NODE_ENV=prod node server.js", "poststop": "mongo admin --eval 'db.shutdownServer()'", "predev": "mongod", "dev": "NODE_ENV=dev nodemon…
Janosh
  • 3,392
  • 2
  • 27
  • 35
5
votes
1 answer

Can I trap signals in R?

In bash I can trap SIGINT, SIGKILL, SIGTERM, and so on. That allows me to do different things depending how the program was unexpectedly stopped. Is there a way to do this in R?
isomorphismes
  • 8,233
  • 9
  • 59
  • 70
5
votes
1 answer

SIGTERM unable to kill process

I have a single-threaded process which is not dying on kill -TERM. The process signal mask does not show that SIGTERM is blocked. I'm executing 'kill' as root. I'm able to kill the process using SIGKILL but this is part of a larger system and I'd…
Abhishek Rai
  • 123
  • 1
  • 1
  • 6
5
votes
2 answers

pcntl_wait not interrupted by SIGTERM

According to the PHP docs for pcntl_wait, The wait function suspends execution of the current process until a child has exited, or until a signal is delivered whose action is to terminate the current process or to call a signal handling…
ThisSuitIsBlackNot
  • 23,492
  • 9
  • 63
  • 110
4
votes
1 answer

Application not entering Posix Signal handler in release mode

I am trying to gracefully shutdown my Console application on a linux arm device. The signal that is sent is SIGTERM. I implemented a Posix Sgnal Handler with the new PosixSignalRegistration.Create() method. This works perfectly when compiled in…
Jeanot Zubler
  • 979
  • 2
  • 18
4
votes
1 answer

How to execute code on SIGTERM in Django request handler thread

I'm currently trying to understand the signal handling in Django when receiving a SIGTERM. Background information I have an application with potentially long running requests, running in a Docker container. When Docker wants to stop a container, it…
FlorianK
  • 400
  • 2
  • 14
4
votes
1 answer

Celery task re-queued into broker on graceful shutdown when run locally but get lost in kubernetes despite same configs

I have a celery running in k8 pod. This is my manifest for celery apiVersion: apps/v1 kind: Deployment metadata: name: celery labels: deployment: celery spec: replicas: 2 selector: matchLabels: pod: celery template: …
4
votes
1 answer

Does Kubernetes send a signal before restarting a pod?

Kubernetes sends a SIGTERM signal to containers in a pod before terminating the pod Does it send a similar signal when it restarts a pod?
Abdulrahman Bres
  • 2,603
  • 1
  • 20
  • 39
4
votes
2 answers

bash not reacting to signals

Let's consider following script: #!/bin/bash while true ; do: ; done After running the script, the bash goes into loop, but can be interrupted (by pressing Ctrl-C or issuing kill -2 command) or terminated (by issuing kill command). All works…
Krzysztof
  • 73
  • 1
  • 4
4
votes
1 answer

kill process using sigterm and escalate to sigkill after timeout

Is there a way to sigterm a process with a timeout? If the process does not gracefully terminate within 30 minutes, the process should get sigkill. Ideally, this graceful shutdown should be executed on the background.
dwong
  • 103
  • 5
  • 14
4
votes
2 answers

How to kill a python program (which includes ROS and twisted protocol) in a clean way when Ctrl+c is pressed?

I have made a ROS node that establishes connection with the client using twisted protocol of python. The program is working as expected but when I try to kill the program using Ctrl+c, it displays following error…
Telepresence
  • 619
  • 2
  • 7
  • 22
1 2
3
15 16