Operating System - Linux
1753492 Members
4976 Online
108794 Solutions
New Discussion юеВ

Re: Reserved SIGNAL for application

 
Lalit Seth
Frequent Advisor

Reserved SIGNAL for application

Hi,

There are 2 reserved signals for application namely SIGUSR1 and SIGUSR2.

In my application i already have used these 2 reserved signals. now, i have an requiremnt to send one more notication to application using signal. How can i acheive this.

I have used SIGUSR1 to pause, SIGUSR2 to resume. I need to sent one more signal to check table values in database.

How can i send this custom signal as both SIGUSR1 and SIGUSR2 are already occupied.

Many Thanks
2 REPLIES 2
Gregory Fruth
Esteemed Contributor

Re: Reserved SIGNAL for application

Perhaps you could use SIGTSTP and SIGCONT
for your existing pause/resume feature.
I believe SIGTSTP is the signal sent by
the shell when when you type Control-Z, and
SIGCONT is the signal sent when you do an
"fg" or "bg" to resume. If your app doesn't
interact with the shell or otherwise need
SIGTSTP or SIGCONT then I think it's safe to
re-use them.
Stuart Browne
Honored Contributor

Re: Reserved SIGNAL for application

The other thing is that you can trap *ANY* signal (except for SIGKILL) and do whatever you want on it.

For instance, if it's a daemon, you could use 'SIGHUP' (which in daemons is usually used to re-read configuration files etc.), or 'SIGINT' (same as hitting ctrl-c, interrupt) or any other of which doesn't do something you want it too.
One long-haired git at your service...