473,395 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Default behavior on SIGTERM?

I hope you will forgive the slightly OT post, but I haven't had any
luck getting answers in the Unix/Solaris groups. I know the C++
standard doesn't mention signals because they are a platform-specific
topic, but I'm hoping someone here can help me nonetheless.

When a Unix C++ application (Solaris 9 in my case) receives a SIGTERM
signal, do any of the standard C++ handlers get called? Of course I'm
assuming the app hasn't explicitly trapped SIGTERM by installing a
handler for it -- I'm just asking about default behavior.

Do any of the C++ handlers installed by atexit(), set_unexpected(), or
set_terminate() get called? Or is it just as if abort() was called
asynchronously when the SIGTERM arrived? My tests show no C++ handlers
get called, but I thought I'd get a second opinion in case I'm simply
doing something wrong.

Thanks.

Jul 23 '05 #1
2 9439
sp**@grog.net wrote:
I hope you will forgive the slightly OT post, but I haven't had any
luck getting answers in the Unix/Solaris groups. I know the C++
standard doesn't mention signals because they are a platform-specific
topic, but I'm hoping someone here can help me nonetheless.

When a Unix C++ application (Solaris 9 in my case) receives a SIGTERM
signal, do any of the standard C++ handlers get called? Of course I'm
assuming the app hasn't explicitly trapped SIGTERM by installing a
handler for it -- I'm just asking about default behavior.

Do any of the C++ handlers installed by atexit(), set_unexpected(), or
set_terminate() get called? Or is it just as if abort() was called
asynchronously when the SIGTERM arrived? My tests show no C++ handlers
get called, but I thought I'd get a second opinion in case I'm simply
doing something wrong.

Thanks.

man -S 7 signal

The default for SIGTERM is for the kernel to terminate the
process immediately. If you wish to catch SIGTERM, you'll
have to install your own signal handler, or set it to be
ignored. In most implementations the C/C++ libs are unaware
of signals.

Larry
Jul 23 '05 #2
Thanks. So it seems if I don't explicitly provide a signal handler,
SIGTERM is no different than SIGKILL without the core dump.

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andrew Athan | last post by:
I have a python program (snippet below) which does not want to seem to die when I issue a sys.exit() inside the SIGTERM handler. The output below is generated as the result of sending several...
0
by: Brian Reichert | last post by:
On another mailing list, there is a discussion about whether or not it is adequate/proper to manage the MySQL server process via a watchdog script (namely, DJB's daemontools). The point behind...
4
by: Teresa | last post by:
Platform: Unix Tru 64 OSF 4.0D Problem: I spawned 3 processes. Proc A, B and C. My problem is that the parent process, proc A, sends SIGTERM to proc C; However, proc C does not exit some...
0
by: silesius | last post by:
I've been using VS 2003 to develop a webapplication using C#. Today I exported the application to a remote webserver I begun experiencing problems. It's a simple application that retrieves some...
0
by: pkassianidis | last post by:
Hello everybody, I have written a python script which executes some functions and then returns to the python interactive shell prompt (In other words I use the command "#!/usr/bin/python -i "...
6
by: Henry Law | last post by:
I'm trying to debug a Perl problem whose symptoms are that a running Perl process either doesn't receive, or fails inexplicably to handle, a SIGTERM sent from the OS during shutdown (Linux Fedora...
35
by: bukzor | last post by:
I've found some bizzare behavior when using mutable values (lists, dicts, etc) as the default argument of a function. I want to get the community's feedback on this. It's easiest to explain with...
9
by: Trapulo | last post by:
Hello, with ASP.NET 2.0 Ajax every unexpected error is managed client-side with a popup that reports the error to the user. In ASP.NET 3.5 this behavor has been changed: how can I have a similar...
43
by: kenneth | last post by:
Dear all, I have encountered this weird problem. I have a class definition with an __init__ argument 'd' which defaults to {}. This argument is put in the 'self.d' attribute at initialization...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.