daemon in perl

Discussion in 'Perl Misc' started by kaustabh.banerjee@gmail.com, Oct 26, 2007.

  1. Guest

    I have a perl daemon which queries the DB in every 10 secs and checks
    some data. The daemon runs fine for most of the time, but dies
    sometimes with some DB exceptions. I have put eval block to survive
    this.

    But still it breaks sometimes.

    How to survive any exception at all. I just want to run no matter
    what..
     
    , Oct 26, 2007
    #1
    1. Advertising

  2. wrote:
    > I have a perl daemon which queries the DB in every 10 secs and checks
    > some data. The daemon runs fine for most of the time, but dies
    > sometimes with some DB exceptions. I have put eval block to survive
    > this.
    >
    > But still it breaks sometimes.
    >
    > How to survive any exception at all. I just want to run no matter
    > what..
    >


    There's a mis-spelt identifier in line 1234 of your program.

    1. How on earth are we to know what your problem is if you don't show us
    any code?
    2. Don't program around a problem, solve it.

    --
    These are my personal views and not those of Fujitsu Siemens Computers!
    Josef Möllers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize (T. Pratchett)
    Company Details: http://www.fujitsu-siemens.com/imprint.html
     
    Josef Moellers, Oct 26, 2007
    #2
    1. Advertising

  3. Ted Zlatanov Guest

    On Thu, 25 Oct 2007 22:27:50 -0700 wrote:

    kb> I have a perl daemon which queries the DB in every 10 secs and checks
    kb> some data. The daemon runs fine for most of the time, but dies
    kb> sometimes with some DB exceptions. I have put eval block to survive
    kb> this.

    kb> But still it breaks sometimes.

    kb> How to survive any exception at all. I just want to run no matter
    kb> what..

    (you should really find and fix your bug, as Josef Moellers suggested)

    Use fork() to start a copy of your program, then *in the copy* do the
    dangerous work. Use IPC if the parent process must know what the child
    is doing. Make sure you wait for the child process. See `perldoc -f
    fork' and all the related documentation for more information.

    Ted
     
    Ted Zlatanov, Oct 26, 2007
    #3
  4. Guest

    wrote:
    > I have a perl daemon which queries the DB in every 10 secs and checks
    > some data. The daemon runs fine for most of the time, but dies
    > sometimes with some DB exceptions. I have put eval block to survive
    > this.
    >
    > But still it breaks sometimes.


    Have you considered scotch tape? Or at least telling us what errors you
    are getting?

    >
    > How to survive any exception at all. I just want to run no matter
    > what..


    If the database server is on fire, exactly what is the client supposed to
    do? If you want your program to "run" no matter what, even if it doesn't
    do anything useful, then replace all the code with "sleep while 1"

    Xho

    --
    -------------------- http://NewsReader.Com/ --------------------
    The costs of publication of this article were defrayed in part by the
    payment of page charges. This article must therefore be hereby marked
    advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
    this fact.
     
    , Oct 26, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jean-Paul Calderone
    Replies:
    0
    Views:
    481
    Jean-Paul Calderone
    Mar 20, 2009
  2. Floris Bruynooghe
    Replies:
    1
    Views:
    474
    Floris Bruynooghe
    Mar 24, 2009
  3. Grischa Schuering
    Replies:
    1
    Views:
    562
    David Efflandt
    Sep 30, 2003
  4. Simon Andrews

    Kernel warnings about wait from Perl daemon

    Simon Andrews, Jan 15, 2004, in forum: Perl Misc
    Replies:
    13
    Views:
    180
    Ilya Zakharevich
    Jan 21, 2004
  5. Daemon Win32::Daemon;

    , Sep 7, 2006, in forum: Perl Misc
    Replies:
    0
    Views:
    276
Loading...

Share This Page