Look at 

$SIG{INT)=\&catch_signal;


Sub catch_signal {
$signal=shift;
#
# do something 
#

exit;

}

-----Original Message-----
From: NewbeeUnix [mailto:[EMAIL PROTECTED] 
Sent: 13 December 2007 03:57
To: beginners@perl.org
Subject: Re: Not catching HUP signal - Perl Sybase

Sorry for replying late...
The task that I want to achieve is to catch the HUP signal and send
notification about the process. But due to addition of sybase::ctlib
it catches the signal and my program fails.
Another issue is that sybase::ctlib is used throughout in our project
and I cannot change it just for this...
My process runs as a daemon and when it starts up it creates a file
containing pid of it. So that indicates the process is up and runing.
But when the m/c is shutdown, HUP signals are sent to all process
runinig and I want to track it and delete the pid file created. But
its not happeining....
Is there any other way to achive this....

Thanks a lot.

On Dec 8, 9:26 pm, [EMAIL PROTECTED] (Chas. Owens) wrote:
> On Dec 8, 2007 9:28 AM, NewbeeUnix <[EMAIL PROTECTED]> wrote:> Yes I did
tried with Sybase::DBlib and it works with that..
> > I also came to the same conclusion thatCTlibis catching it
> > somehow...
> > Is there a way to not allow that....
> > Also DBlib module cannot be used ... some restrictions are there....
>
> snip
>
> What exactly are you trying to do with Sybase?  If all you want to do
> is run SQL statements against it (the most common case) you are better
> off with the DBI* and DBD::Sybase** modules.  Using the DBI module, a
> database independent framework, will give you a lot more flexibility
> if at some later date you change to a different RDBMS vendor (like
> Oracle, DB2, etc.).  Also, why are you concerned with catching SIGHUP?
>  The only reason, in my mind,  to catch it is to prevent a process
> from exiting when the controlling terminal closes (which shouldn't
> affect a properly created daemon since it wouldn't have a controlling
> terminal).  If Sybase::CTlibis already causing the program to ignore
> SIGHUP then that is one less thing you need to do.
>
> *http://search.cpan.org/dist/DBI/DBI.pm
> **http://search.cpan.org/dist/DBD-Sybase/Sybase.pm


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/



This e-mail is from the PA Group.  For more information, see
www.thepagroup.com.

This e-mail may contain confidential information.  Only the addressee is
permitted to read, copy, distribute or otherwise use this email or any
attachments.  If you have received it in error, please contact the sender
immediately.  Any opinion expressed in this e-mail is personal to the sender
and may not reflect the opinion of the PA Group.

Any e-mail reply to this address may be subject to interception or
monitoring for operational reasons or for lawful business practices.





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to