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

How to get rid of SIGTERM error

i have been working on this iphone app in the new xcode4. Practically every time I exit my application in the simulator I get an error on a code line in the main.m Here is my line of code, and then the error on the next line int retVal =…
Blane Townsend
  • 2,888
  • 5
  • 41
  • 55
10
votes
1 answer

How to test signal handling in RSpec, particularly handling of SIGTERM?

Heroku may send a SIGTERM to your application for various reasons, so I have created a handler to take care of some cleanup in case this happens. Some googling hasn't yielded any answers or examples on how to test this in RSpec. Here's the basic…
wesdotcool
  • 475
  • 4
  • 14
9
votes
1 answer

Linux: get the exit code from the kill command

If I send a SIGTERM signal to a process using the kill command, I expect an exit code, but I always get 0 (zero) when running the below command after killing a process: echo $? According to the answer in this post, I should get 143 when sending a…
Rox
  • 2,647
  • 15
  • 50
  • 85
9
votes
1 answer

Resuming queued jobs after NodeJS worker restart on Heroku

So I have a fairly simple setup on Heroku. I'm using RabbitMQ for handling background jobs. My setup consists of a node script that runs daily using Heroku Scheduler addon. The scripts adds jobs to the queue, the worker in turn, consumes them and…
yohairosen
  • 1,665
  • 1
  • 18
  • 26
9
votes
2 answers

docker stop doesn't work for node process

I want to be able to run node inside a docker container, and then be able to run docker stop . This should stop the container on SIGTERM rather than timing out and doing a SIGKILL. Unfortunately, I seem to be missing something, and the…
sjmeverett
  • 1,277
  • 1
  • 11
  • 23
9
votes
2 answers

Heroku logs FATAL SignalException: SIGTERM

I don't understand why I am getings this FATAL exception. It works just fine in localhost. I understand that SIGTERM is simply a signal to terminate the program, and I don't believe the solution is to handle or ignore it. When I look at the deployed…
stecd
  • 1,681
  • 6
  • 19
  • 28
8
votes
1 answer

How to make a python context manager catch a SIGINT or SIGTERM signal

I stream data using context manager to close the connection when the program exits. I run my program as a daemon in the background. How can I make the context manager handle the case when the daemon is interrupted by a SIGINT or SIGTERM or any…
gohu
  • 151
  • 1
  • 9
8
votes
2 answers

What would cause a SIGTERM to not propagate to child processes?

I have a process on Linux that starts up 20 child processes via fork. When I kill the parent process, it will often kill all of the child processes, but sometimes it doesn't kill all of them, and I'm left with some orphaned processes. This isn't a…
steve8918
  • 1,820
  • 6
  • 27
  • 38
8
votes
1 answer

How much time before SIGKILL

I've tryed to figure out how much time is given to an application to quit when receiving a SIGTERM, before it is send a SIGKILL ? My knowledge of these signal is very low. I've read some of it in the suggested answers on Stackoverflow but I can't…
user3894541
8
votes
2 answers

Detect user logout / shutdown in Python / GTK under Linux - SIGTERM/HUP not received

OK this is presumably a hard one, I've got an pyGTK application that has random crashes due to X Window errors that I can't catch/control. So I created a wrapper that restarts the app as soon as it detects a crash, now comes the problem, when the…
Ivo Wetzel
  • 46,459
  • 16
  • 98
  • 112
7
votes
1 answer

Golang catch sigterm and continue application

Is it possible to catch a sigterm in Golang and move on on the code, like a panic/defer? Example: func main() { fmt.Println("app started") setupGracefulShutdown() for { } close() } func close() { fmt.Println("infinite…
Cae Vecchi
  • 868
  • 1
  • 10
  • 19
7
votes
2 answers

How to process SIGTERM signal gracefully in Java?

Let's assume we have such a trivial daemon written in java: public class Hellow { /** * @param args the command line arguments */ public static void main(String[] args) { while(true) { // 1. do // 2.…
6
votes
2 answers

Node.JS Shutdown Hook

Is it possible to intercept the default kill signal and use it as a command for a graceful shutdown? This is for Solaris SMF. The easiest way to have a stoppable service that I have found is to set :kill as the shutdown script and then to add a…
700 Software
  • 85,281
  • 83
  • 234
  • 341
6
votes
0 answers

hadoop datanodes keep shuthing down with SIGTERM 15

I'm running a hadoop cluster with 24 servers. It has been running for some months, but after the last reboot the datanodes keep dying with the error: 2016-02-05 11:35:56,615 INFO org.apache.hadoop.hdfs.server.datanode.DataNode.clienttrace: src:…
user1753235
  • 199
  • 12
6
votes
2 answers

Is there a posix SIGTERM alternative on Windows? - (A gentle kill for console application)

I have a console daemon that is run by a GUI application. When the GUI application is terminated I'd like to stop the daemon as well. How can I do it in a gentle way on windows? On Linux, I would just use SIGTERM is there a similar mechanism on…
Piotr Czapla
  • 25,734
  • 24
  • 99
  • 122
1
2
3
15 16