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

The pod PreStop hook is hanging in Terminating status and is killed only after terminationGracePeriodSeconds

I have a preStop hook defined in a statefulset pod resource that runs a bash script to make sure not to kill the pod until few processes finishes/cancels/errors within an application. I don't have the terminationGracePeriodSeconds defined. Now when…
acm
  • 77
  • 3
  • 11
2
votes
0 answers

SIGTERM in node.js on Windows

I am new to node.js and following some tutorials. In one of them, I execute the following code and expect to shutdown the terminal gracefully which is not the case process.stdin.resume(); process.stdin.setEncoding('utf8'); process.stdin.on('data',…
eliassal
  • 343
  • 5
  • 20
2
votes
2 answers

How to fix: Apache httpd container for Docker shuts down unexpectedly (SIGTERM)

I'm using an httpd:alpine container to deploy a website developed on Angular, without using Node (due to several restrictions in the production environment). I'm actually using this amazing guide by Andreas Lorenzen as a base, specially the…
rafamartinc
  • 125
  • 1
  • 1
  • 10
2
votes
1 answer

python SIGTERM handler is not invoked in multiprocessing

I replicated the following snippet to reproduce an issue I am facing while dealing with SIGTERM handler: a main process, with a SIGTERM handler. a thread spawned from main process a subprocess spawned from the above thread The intention is to…
Barun Sharma
  • 1,452
  • 2
  • 15
  • 20
2
votes
3 answers

Python SIGINT SIGTERM does not exit instantly a while loop

def do_stuff_before_python_terminates(): save_variables_in_mysql() do_this_and_that()... def main(): do stuff while loops ect... def sigterm(x, y): raise Exception() def sigint(signal, frame): raise…
Human Khoo
  • 135
  • 3
  • 9
2
votes
0 answers

systemd killed my screen session by sigterm

/var/log/syslog has following lines: Mar 13 05:02:34 corben systemd[1]: Stopping User Manager for UID 1000... Mar 13 05:02:34 corben systemd[1]: Stopped target Graphical Interface. Mar 13 05:02:34 corben systemd[1]: session-1257696.scope: Killing…
YYY
  • 53
  • 3
2
votes
1 answer

What to do with std::thread after it was killed?

Suppose we have a threaded program. We create some resources (i.e. mutexes), spawn threads that do their own initialization, wait for them to finish, then destroy resources. void run(void) { some_resource global_resource; …
haael
  • 972
  • 2
  • 10
  • 22
2
votes
1 answer

Will a pod be restarted with send SIGTERM by Kubernetes

I want to reduce the number of my pods with full control over the pod that should be shut down. Right now I reduce the number of pods and Kubernetes sends a SIGTERM and after 30 Secounds the pod will be deleted. I want to know when I listen to the…
cre8
  • 13,012
  • 8
  • 37
  • 61
2
votes
5 answers

How can a process kill itself?

#include #include #include int main(){ pid_t pid = fork(); if(pid==0){ system("watch ls"); } else{ sleep(5); killpg(getpid(),SIGTERM); //to kill the complete…
Durin
  • 2,070
  • 5
  • 23
  • 37
2
votes
1 answer

How to determine why sigterm was sent to process running inside docker container on mesos?

I have a docker container that I can excecute fine locally. Yet when run on a mesos cluster, I get SIGTERMS /usr/my_script.sh: line 57: 310 Killed xsltproc sort.xsl ${2} > ${2}_bat W0703 09:09:54.465442 5074 logging.cpp:91] RAW: Received signal…
k0pernikus
  • 60,309
  • 67
  • 216
  • 347
2
votes
1 answer

Force twisted reactor to stop on sigterm

I have a GCE server setup to handle some data analysis. I can communicate with it via ws using twisted. I am the only client of this server. System is setup like this: spawn_multiprocessing_hierarchy() reactor.run() # Blocks main…
Mirac7
  • 1,566
  • 4
  • 26
  • 44
2
votes
1 answer

Catch all signals that would stop a program

I've got a program to catch any terminating signals. Currently all it does is catch Ctrl + C. I want to be able to catch Ctrl + Z and Ctrl + \ in addition to Ctrl + C. Here's part of my code. if (signal(SIGINT, SIG_IGN) == SIG_ERR) …
MD XF
  • 7,860
  • 7
  • 40
  • 71
2
votes
0 answers

Gracefully stopping scrapy spider in Jenkins

I use Jenkins to schedule my scrapers written in Python scrapy framework. I use "closed" spider method to prepare results after scraping is done. The problem is that if I will decide to stop my spider earlier with "stop" button in Jenkins, it sends…
2
votes
1 answer

How quickly should a process exit after receiving SIGTERM?

Is there some guideline on how much time a linux process should maximally take to exit after receiving a SIGTERM signal? EDIT: I'm asking because I have to decide on timeouts for blocking I/O calls.
Fran Borcic
  • 696
  • 6
  • 8
2
votes
1 answer

Is it possible to write a batch [or other executable] application which ignores SIGTERM in all its forms , in Windows

I am trying to create a console application which hangs up in a way that pressing CTRL + BREAK or sending a SIGTERM signal to the process doesn't terminate it [i.e. it keeps on hanging, without closing]. I want to test that it keeps on going with…