PRO*C and signals

From: joseph.m.miklewicz <jmjm_at_cbnewsm.cb.att.com>
Date: Tue, 2 Nov 1993 15:14:43 GMT
Message-ID: <CFvECy.HF2_at_cbnewsm.cb.att.com>


Folks,

I am running:

SunOs 4.1.2
Oracle 7.0.12
PRO*C 1.5.6.2.1 I am trying to write a daemon that uses the dbms_alert package to "distribute" database alerts to our various applications and/or kick off another "C" process when a database event occurs. The daemon uses the dbms_alert.register() procedure to register for the events its interested in an dbms_alert.remove() to unregister when it terminates. It uses dbms_alert.waitany() to wait for the alerts.

I have defined a "hangup" alert which is the event that tells the daemon to terminate. When I cause this alert the daemon unregisters all of the alerts and terminates with no problem.

Where I am having difficulty is when I try to terminate the daemon by issuing a kill of SIGTERM. This is the most likely way the daemon will be terminated since it will be started out of /etc/rc.local and will be terminated by shutdown, which issues a SIGTERM.

The code I execute to terminate is the same whether the daemon receives the "hangup" alert or the SIGTERM. The difference is that when I issue a SIGTERM a signal handler invokes the unregister function. What happens in this case is the first REMOVE() call hangs. What I suspect is that the SIGTERM I send my daemon is somehow affecting the shadow process as well. Are you allowed to do your own signal handling in PRO*C? I can't find any references to it in any of the OCI and/or pre-compiler documentation.

Any info on this topic would be appreciated.

Joe Miklewicz 908-949-3061 jmjm_at_hogpa.att.com

-- 
Joe Miklewicz	908-949-3061	jmjm_at_hogpa.att.com
Received on Tue Nov 02 1993 - 16:14:43 CET

Original text of this message