Sponsored Content
Top Forums Shell Programming and Scripting Continue Processing after a signal is caught Post 302917580 by Soham on Wednesday 17th of September 2014 03:21:16 PM
Old 09-17-2014
Yes. I would like to come back and continue. The basic idea is to retry for three times and then error out.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Signal Processing

Hello, Can any body give example of using Unix Signals. What I want to do is I am running a sql query in a shell script I want, if sql query exceed the defined no. of seconds limit, then I would like to kill the process. I know this can be done thru Unix Signal Handling but I do not know... (8 Replies)
Discussion started by: sanjay92
8 Replies

2. AIX

process caught signal 5

Hello, We are using AIX 5.2 ML 7. One of the process in its log file said the following and stopped running. Caught signal=5, exiting. What would cause the signal 5 to be generated on an AIX box. Please advise. Thx Jerardfjay (2 Replies)
Discussion started by: jerardfjay
2 Replies

3. Programming

Signal processing

We have written a deamon which have many threads. We are registering for the SIGTERM and trying to close main thread in this signal handling. Actually these are running on Mac OS X ( BSD unix). When we are unloading the deamon with command launchctl, it's sending SIGTERM signal to our process... (1 Reply)
Discussion started by: Akshay4u
1 Replies

4. Solaris

Solaris 10 install issue - "Caught Signal 11"

Rebuilding a server (T2000) from a flash archive I created on another server. Using a Solaris 10/08 DVD to boot from the was going to point it tot he flash archive and pull it over NFS. I've done this many times with success until now. It initially boots off the DVD, you input the... (5 Replies)
Discussion started by: Probos
5 Replies

5. Shell Programming and Scripting

How to continue in the loop after trapping signal

hi all.... plz tel me how can i solve this....here's the situation (just a sample!!).. $ cat sigtrap #!/usr/bin/perl $SIG{'INT'} = 'ABORT'; sub ABORT { print "\nStop the loop?? (y/n) : "; chop($ch=<STDIN>); if ($ch =~ //) { ... (3 Replies)
Discussion started by: tprayush
3 Replies

6. Solaris

Solaris 10 upgrade exiting ( caught signal 11)

Hi, I am pretty new to Solaris and am trying to upgrade from the OBP. I go through the process of booting from the cdrom, entering all necessary information and running the upgrade. The system completes analysis and then fail with the EXITING (caught signal 11) error I believe that... (5 Replies)
Discussion started by: Seanliam
5 Replies

7. Shell Programming and Scripting

Bypass getopts errors and continue processing?

Is there a way to do this? while getopts "n:g:m:i:p:d:a:" OPTION do case $OPTION in ... if i do a ./script.sh -n john -u user -p password, it will output: name= john ./script.sh: illegal option -- u Is there a way to skip over errors so that -p will get processed as well? By... (7 Replies)
Discussion started by: etranman1
7 Replies

8. Solaris

Solaris 10 "Exiting (caught signal 11)"

I get an error after the initializing screen. I am using a DVD/ROM to boot up the installation on a Dell Inspiron 1520. Segmentation fault - core dumped. I have tried to restart multiple times. Please help (1 Reply)
Discussion started by: Jimasaurus
1 Replies

9. Solaris

Exiting (caught signal 11)

I created a new Virtual machine and was trying to install Solaris but keep getting this error.:confused: EXITING (caught signal 11) Type "install-solaris to restart" Can't find anything on Google. This is the iso image I am using "sol-10-u11-ga-x86-dvd" Followed all the instructions on... (5 Replies)
Discussion started by: newborndba
5 Replies
LWP::UserAgent::Determined(3pm) 			User Contributed Perl Documentation			   LWP::UserAgent::Determined(3pm)

NAME
LWP::UserAgent::Determined - a virtual browser that retries errors SYNOPSIS
use strict; use LWP::UserAgent::Determined; my $browser = LWP::UserAgent::Determined->new; my $response = $browser->get($url, headers... ); DESCRIPTION
This class works just like LWP::UserAgent (and is based on it, by being a subclass of it), except that when you use it to get a web page but run into a possibly-temporary error (like a DNS lookup timeout), it'll wait a few seconds and retry a few times. It also adds some methods for controlling exactly what errors are considered retry-worthy and how many times to wait and for how many seconds, but normally you needn't bother about these, as the default settings are relatively sane. METHODS
This module inherits all of LWP::UserAgent's methods, and adds the following. $timing_string = $browser->timing(); $browser->timing( "10,30,90" ) The "timing" method gets or sets the string that controls how many times it should retry, and how long the pauses should be. If you specify empty-string, this means not to retry at all. If you specify a string consisting of a single number, like "10", that means that if the first request doesn't succeed, then "$browser->get(...)" (or any other method based on "request" or "simple_request") should wait 10 seconds and try again (and if that fails, then it's final). If you specify a string with several numbers in it (like "10,30,90"), then that means $browser can retry as that many times (i.e., one initial try, plus a maximum of the three retries, because three numbers there), and that it should wait first those numbers of seconds each time. So "$browser->timing( "10,30,90" )" basically means: try the request; return it unless it's a temporary-looking error; sleep 10; retry the request; return it unless it's a temporary-looking error; sleep 30; retry the request; return it unless it's a temporary-looking error; sleep 90 the request; return it; The default value is "1,3,15". $http_codes_hr = $browser->codes_to_determinate(); This returns the hash that is the set of HTTP codes that merit a retry (like 500 and 408, but unlike 404 or 200). You can delete or add entries like so; $http_codes_hr = $browser->codes_to_determinate(); delete $http_codes_hr->{408}; $http_codes_hr->{567} = 1; (You can actually set a whole new hashset with "$browser->codes_to_determinate($new_hr)", but there's usually no benefit to that as opposed to the above.) The current default is 408 (Timeout) plus some 5xx codes. $browser->before_determined_callback() $browser->before_determined_callback( &some_routine ); $browser->after_determined_callback() $browser->after_determined_callback( &some_routine ); These read (first two) or set (second two) callbacks that are called before the actual HTTP/FTP/etc request is made. By default, these are set to undef, meaning nothing special is called. If you want to alter try requests, or inspect responses before any retrying is considered, you can set up these callbacks. The arguments passed to these routines are: 0: the current $browser object 1: an arrayref to the list of timing pauses (based on $browser->timing) 2: the duration of the number of seconds we'll pause if this request fails this time, or undef if this is the last chance. 3: the value of $browser->codes_to_determinate 4: an arrayref of the arguments we pass to LWP::UserAgent::simple_request (the first of which is the request object) (5): And, only for after_determined_callback, the response we just got. Example use: $browser->before_determined_callback( sub { print "Trying ", $_[4][0]->uri, " ... "; }); IMPLEMENTATION
This class works by overriding LWP::UserAgent's "simple_request" method with its own around-method that just loops. See the source of this module; it's straightforward. Relatively. SEE ALSO
LWP, LWP::UserAgent COPYRIGHT AND DISCLAIMER
Copyright 2004, Sean M. Burke, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. AUTHOR
Originally created by Sean M. Burke, "sburke@cpan.org" Currently maintained by Jesse Vincent "jesse@fsck.com" perl v5.14.2 2012-05-21 LWP::UserAgent::Determined(3pm)
All times are GMT -4. The time now is 03:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy