I am having exactly the same problem with Application Cleanup during Linux Shutdown but the thread is old and closed. The only difference is that I use sigaction() instead of signal(), which is recommended, as far as I know.
This is my code:
And this is some usage that shows that it is working:
If I normally shutdown or log out then the process is killed without the clean up taking place.
Hi,
Iam calling 3 sql scripts through one shell script 'rmia.sh'.
Till now this was working fine, but last time while calling the SQL scripts,
Oracle was down. But amazingly the exit status was '0' (success)!!!
Below is the shell code:
#!/usr/bin/ksh -x
assign_file asql a.sql 1... (15 Replies)
Ok here is the problem we have 2 v440 with same IP address running solars 9. one remains on the other remains off. They are both configured exactly the same for redundant purposes for the software we use. This was the best/worst idea. Great because down time is only a mere minutes. The bad is the... (7 Replies)
I am working on a SUN T2000 machine with Solaris 10 running on it. When I checked the system this morning, I found it to be turned off. The lastreboot command showed that the system had been shut down the previous night.
I want to find out how the system was shut down. I have run hardware health... (2 Replies)
I want to only send a mail before my system goes for a shutdown or reboot. I don't want a mail when it comes up after a reboot or is normally started.. How can i achieve this? (2 Replies)
Hello,
from last few days my laptop is not whutting down properly.. when ever i ty to shutdown it restarts again.. what may be problem?? antivirus is updated till date.. and i use windows xp sp2....
regards,
deepak. (5 Replies)
Hi everybody,
I am working on a bigger awk script in which one part is comparing the size of two files.
I want to evaluate which file is bigger and then just save the bigger one.
I got it all working except for the part where I want to figure out which file is bigger; the one awk is currently... (2 Replies)
Hi All,
I have one situation to shut-down the system through shell script.I need script command to shut-down the system and process should end(safe-mode) the MyEclipse. (0 Replies)
Discussion started by: stsivaraj
0 Replies
LEARN ABOUT CENTOS
bsd_signal
BSD_SIGNAL(3) Linux Programmer's Manual BSD_SIGNAL(3)NAME
bsd_signal - signal handling with BSD semantics
SYNOPSIS
#define _XOPEN_SOURCE /* See feature_test_macros(7) */
#include <signal.h>
typedef void (*sighandler_t)(int);
sighandler_t bsd_signal(int signum, sighandler_t handler);
DESCRIPTION
The bsd_signal() function takes the same arguments, and performs the same task, as signal(2).
The difference between the two is that bsd_signal() is guaranteed to provide reliable signal semantics, that is: a) the disposition of the
signal is not reset to the default when the handler is invoked; b) delivery of further instances of the signal is blocked while the signal
handler is executing; and c) if the handler interrupts a blocking system call, then the system call is automatically restarted. A portable
application cannot rely on signal(2) to provide these guarantees.
RETURN VALUE
The bsd_signal() function returns the previous value of the signal handler, or SIG_ERR on error.
ERRORS
As for signal(2).
CONFORMING TO
4.2BSD, POSIX.1-2001. POSIX.1-2008 removes the specification of bsd_signal(), recommending the use of sigaction(2) instead.
NOTES
Use of bsd_signal() should be avoided; use sigaction(2) instead.
On modern Linux systems, bsd_signal() and signal(2) are equivalent. But on older systems, signal(2) provided unreliable signal semantics;
see signal(2) for details.
The use of sighandler_t is a GNU extension; this type is defined only if the _GNU_SOURCE feature test macro is defined.
SEE ALSO sigaction(2), signal(2), sysv_signal(3), signal(7)COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
2009-03-15 BSD_SIGNAL(3)