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
1
vote
0 answers
SIGTERM not received by Mac OS Daemon
I have a Mac OS X Carbon Daemon that runs as root. It needs to receive and handle SIGTERM (and other signals) in order for it to terminate properly. The code looks something like this:
static void sig_hup(int sig)
{
fprintf(stderr, "Caught signal…

Ole Bjørn Setnes
- 748
- 5
- 20
1
vote
1 answer
SIGTERM signal handling confusion
I am running a program which invokes a shell script (for discussion sh1 with pid 100).
This script in turn invokes another script (for discussion sh2 with pid 101) and waits for it to finish. sh2(child script) takes about 50 seconds to finish.
The…

sdn_world
- 263
- 2
- 10
1
vote
0 answers
ShutdownHook is not called on 'kill -TERM '
I have this sample application from here
public class ExampleSignalHandler {
public static void main(String... args) throws InterruptedException {
final long start = System.nanoTime();
Runtime.getRuntime().addShutdownHook(new Thread(new…

user2071938
- 2,055
- 6
- 28
- 60
1
vote
1 answer
shutting down a php process using pcntl_signal when running a thread
When running a thread, the function registered with pcntl_signal, never gets fired.

luistar15
- 163
- 1
- 9
1
vote
2 answers
Use GDB to Debug SIGTERM
I have searched several questions on stackoverflow about debugging SIGTERM, but have not get the information I needed. Perhaps, I am still new to this issue.
My program terminated with the SIGTERM signal without core dump and I donot know how to…

day
- 1,047
- 3
- 11
- 20
1
vote
1 answer
Can't trap SIGTERM with sigaction function
I compiled the program. Starting it and waiting. I open the other terminal, and kill the any running program with command "kill pid" or "kill -15 pid" or "kill -SIGTERM pid" (replace PID with the actual process ID). The killed program is exit, but…

Hoang
- 55
- 1
- 2
- 10
1
vote
0 answers
Apache Server 2.4 on EC2 "caught SIGTERM shutting down "
I'm using amazon linux on an m3.large instance on EC2.
I had these logs before my apache server was shut down:
[Sun Sep 28 18:54:31.679261 2014] [cgi:error] [pid 32422] [client 67.211.230.58:58937]
script not found or unable to stat:…

edam
- 910
- 10
- 29
1
vote
2 answers
External java program: Handle SIGTERM
I have java program (with a gui) which is running on a host. On runtime a user can add some data records. The program just works with them.
Later the system maybe shuts down or the program is just closed by SIGTERM.
Unfortunately the porgram only…

Kevin Meier
- 2,339
- 3
- 25
- 52
1
vote
1 answer
Keeping a program running last during shutdown with supervisor (Linux)
I have a server with supervisor which runs two programs. Let's call them Program A and Program B. When the server gets shutdown. Program A's execution is terminated before Program B, which results in errors before the shutdown is completed. Is there…

Loic Duros
- 5,472
- 10
- 43
- 56
1
vote
1 answer
Have Gnu Screen Pass SIGTERM Signal to Child Processes, Allowing Them To Shut Down Cleanly
We are using Upstart to launch/terminate an in-house developed binary.
In the Upstart configuration file for this binary, we define the script as such:
script
exec su - user -c "screen -D -m -S $product /opt/bin/prog /opt/cfg/$product -v 5…

Swoop
- 514
- 5
- 17
1
vote
1 answer
Java process doesn't exit on SIGTERM under heavy load
In normal operation my application exits fine when sent a 'kill -s SIGTERM '.
However, under load sometimes the process does not exit.
I'm just wondering if it possible that http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6392332 is the reason…

user1977749
- 83
- 6
1
vote
1 answer
Heroku Java Tomcat ServletContextListener not calling contextDestroyed on slugc or restart
Heroku uses SIGTERM to allow processes to gracefully shutdown. However the Tomcat process does not respond to SIGTERM and the never calls contextDestroyed on my ServletContextListener.
How do I get Tomcat to call contextDestroyed using Heroku…

user1796571
- 662
- 2
- 9
- 21
1
vote
2 answers
Linux kill() error unexpected
Kill(pid, 0) seems to not set the error code correctly...as stated in man for kill
Errors
The kill() function shall fail if:
EINVAL The value of the sig argument is an invalid or unsupported
signal number.
EPERM The process does not have…

JonH
- 501
- 7
- 13
- 25
1
vote
1 answer
Java: Kill all subprocesses on unix
I got an application written in java which runs on Unix and starts two sub-processes (via Runtime.getRuntime().exec()) on startup. If the application crashed for some reason, the sub processes won't get killed.
Now, I added a shutdown hook which…

Florian Müller
- 7,448
- 25
- 78
- 120
0
votes
1 answer
Python: interrupting urllib2.urlopen() with SIGTERM
I'm using urllib2.urlopen() to open sometimes potentially large files. I have a signal handler to catch SIGTERM, but is it possible to actually interrupt urlopen() when it's downloading a big file to close my program immediately, without waiting for…

meteoritepanama
- 6,092
- 14
- 42
- 55