<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Perl daemon question in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/perl-daemon-question/m-p/3641355#M69049</link>
    <description>You can try as,&lt;BR /&gt;&lt;BR /&gt;sub catch_signal {&lt;BR /&gt;  print("Got HUP signal!\n");&lt;BR /&gt;         }&lt;BR /&gt;&lt;BR /&gt;$SIG{HUP} = 'catch_signal'&lt;BR /&gt;         for ($x = 0; $x &amp;lt; 10; $x++) {&lt;BR /&gt;             print("$x\n");&lt;BR /&gt;             sleep 1;&lt;BR /&gt;         }&lt;BR /&gt;&lt;BR /&gt;hth.</description>
    <pubDate>Tue, 04 Oct 2005 07:33:36 GMT</pubDate>
    <dc:creator>Muthukumar_5</dc:creator>
    <dc:date>2005-10-04T07:33:36Z</dc:date>
    <item>
      <title>Perl daemon question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-daemon-question/m-p/3641354#M69048</link>
      <description>Hi,&lt;BR /&gt;i wrote small useful (only for me :) perl daemon, but I can't adjust its behaviour for signal HUP. I know i can ignore signal by setting... &lt;BR /&gt;$SIG{HUP} = 'IGNORE'&lt;BR /&gt;, but I need execute my procedure. If i set... &lt;BR /&gt;$SIG{HUP} = \&amp;amp;catch_signal&lt;BR /&gt;then the procedure is executed, but then it is finished with...&lt;BR /&gt;Interrupted system call at ./x.pl line...&lt;BR /&gt;&lt;BR /&gt;Is there any possibility to "mask" the signal a nd execute my procedure only?&lt;BR /&gt;&lt;BR /&gt; Thanks for any help&lt;BR /&gt;  PF</description>
      <pubDate>Tue, 04 Oct 2005 07:26:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-daemon-question/m-p/3641354#M69048</guid>
      <dc:creator>Josef Forman</dc:creator>
      <dc:date>2005-10-04T07:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: Perl daemon question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-daemon-question/m-p/3641355#M69049</link>
      <description>You can try as,&lt;BR /&gt;&lt;BR /&gt;sub catch_signal {&lt;BR /&gt;  print("Got HUP signal!\n");&lt;BR /&gt;         }&lt;BR /&gt;&lt;BR /&gt;$SIG{HUP} = 'catch_signal'&lt;BR /&gt;         for ($x = 0; $x &amp;lt; 10; $x++) {&lt;BR /&gt;             print("$x\n");&lt;BR /&gt;             sleep 1;&lt;BR /&gt;         }&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Tue, 04 Oct 2005 07:33:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-daemon-question/m-p/3641355#M69049</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-10-04T07:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Perl daemon question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-daemon-question/m-p/3641356#M69050</link>
      <description>Just put ; after $SIG{HUP} = 'catch_signal' ;)&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Tue, 04 Oct 2005 07:35:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-daemon-question/m-p/3641356#M69050</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-10-04T07:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: Perl daemon question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-daemon-question/m-p/3641357#M69051</link>
      <description>My try as,&lt;BR /&gt;&lt;BR /&gt;#!/usr/contrib/bin/perl&lt;BR /&gt;sub INT_handler {&lt;BR /&gt;       print("Don't Interrupt!\n");&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;$SIG{HUP} = 'INT_handler';&lt;BR /&gt;for ($x = 0; $x &amp;lt; 10; $x++) {&lt;BR /&gt;    print("$x\n");&lt;BR /&gt;    sleep 10;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;# ./tst.pl &amp;amp;&lt;BR /&gt;[1]     26431&lt;BR /&gt;# 0&lt;BR /&gt;&lt;BR /&gt;# kill -1 26431&lt;BR /&gt;Don't Interrupt!&lt;BR /&gt;1&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Oct 2005 07:37:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-daemon-question/m-p/3641357#M69051</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-10-04T07:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: Perl daemon question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-daemon-question/m-p/3641358#M69052</link>
      <description>I have ; at the end :)&lt;BR /&gt;You can check torso of my script...&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Oct 2005 08:01:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-daemon-question/m-p/3641358#M69052</guid>
      <dc:creator>Josef Forman</dc:creator>
      <dc:date>2005-10-04T08:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Perl daemon question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-daemon-question/m-p/3641359#M69053</link>
      <description>Ok. Keep continuing with this flow. Get back if you have any problem.&lt;BR /&gt;&lt;BR /&gt;Note: Post this scripting related in hp-ux so that you will more really faster responses.&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Wed, 05 Oct 2005 01:24:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-daemon-question/m-p/3641359#M69053</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-10-05T01:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Perl daemon question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/perl-daemon-question/m-p/3641360#M69054</link>
      <description>Hi Josef,&lt;BR /&gt; &lt;BR /&gt;have you had a look at "perldoc perlipc" yet?&lt;BR /&gt; &lt;BR /&gt;There are plenty of short signal handler sample codes.&lt;BR /&gt; &lt;BR /&gt;Also regard the warning note in perlipc about  not re-entrant system libraries.&lt;BR /&gt;At least prior to Perl 5.8 signal handlers should implement as little (clean-up) action as possible.&lt;BR /&gt;  &lt;BR /&gt;Btw. it's better to stick to your usage of sub refs (i.e. the \&amp;amp; form) than the use of symbolic refs of Muthu&lt;BR /&gt;(although if you didn't use strict 'refs', and stayed in the same package scope you probably wouldn't notice a difference).&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Oct 2005 06:42:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/perl-daemon-question/m-p/3641360#M69054</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2005-10-05T06:42:59Z</dc:date>
    </item>
  </channel>
</rss>

