Hiya, Monks!

I have a bunch of perl scripts that have runtimes that extend past 24 hours. Mostly I am reading tape drives and passing hundreds of gigs through thumbnailing and conversion utilities. Usually I just run these out of my terminal window. However, my laptop is prone to crashing while our servers (ultra 10s) are not. So I run them nohup and watch the output.

There is no TTY input requested (<> for example), but some of my jobs are dying with SIGTTIN. The ever helpful manpage for signal(5) has this to say:

SIGTTIN 26 Stop Stopped (tty input) (see termio(7I))
Now, my feeling here is that the machine thinks my program is asking for input and there is no controlling tty so it is dying.

If his highness tilly doesn't mind, i'd like to have a discussion about signals in perl. And japhy has something to contribute here too because of a discussion we had on fun with perl a few months ago.

$SIG{TTIN} = \&amp;amp;next;
This seems strange. Youre executing next outside of a loop? Well, as I understand it, you can use last to get out of a loop like this:
$SIG{INT} = sub { last };
and in fact, Randal recommended this and said he uses it frequently on a program that may be having a problem in a loop so he can ^C out of the loop -- but not the program. People scorned the "solution", but I think it has a certain elegance to it.

This is all fine and good, but even the perl documentation (I forget which doc at the moment) mentions that Solaris is among the unixen with hopelessly b0rked signals. And, I've been bitten by this before.

So what I'd like to do is catch this SIGTTIN and skip whatever my code is doing that is pissing solaris off.

Comments? Ideas?

brother dep.

--
Laziness, Impatience, Hubris, and Generosity.


In reply to Signal (SIGTTIN) in Solaris 8. (code) by deprecated

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.