Loading ...
Sorry, an error occurred while loading the content.

Re: [mp1] signal handler for USR2 in startup.pl doesn't work

Expand Messages
  • Gary Denslow
    this is working for me. thanks for the suggestion! use POSIX; my $sigset = POSIX::SigSet- new(); my $action = POSIX::SigAction- new( sigUSR2_handler ,
    Message 1 of 6 , Jan 7, 2004
    • 0 Attachment
      this is working for me.  thanks for the suggestion!
       
      use POSIX;
       
      my $sigset = POSIX::SigSet->new();
      my $action = POSIX::SigAction->new(
          'sigUSR2_handler',
          $sigset,
          &POSIX::SA_NODEFER,
      );
       
      POSIX::sigaction(&POSIX::SIGUSR2, $action);

      sub sigUSR2_handler {
          warn "got SIGUSR2\n";
      }
    • Torsten Foertsch
      ... Hash: SHA1 ... It doesn t work for me. I the weak point is the symbolic reference to your sig handler. I d prefer hard a reference: -
      Message 2 of 6 , Jan 8, 2004
      • 0 Attachment
        -----BEGIN PGP SIGNED MESSAGE-----
        Hash: SHA1

        On Wednesday 07 January 2004 23:10, Gary Denslow wrote:
        > this is working for me. thanks for the suggestion!
        >
        > use POSIX;
        >
        > my $sigset = POSIX::SigSet->new();
        > my $action = POSIX::SigAction->new(
        > 'sigUSR2_handler',
        > $sigset,
        > &POSIX::SA_NODEFER,
        > );
        >
        > POSIX::sigaction(&POSIX::SIGUSR2, $action);
        >
        > sub sigUSR2_handler {
        > warn "got SIGUSR2\n";
        > }

        It doesn't work for me. I the weak point is the symbolic reference to your sig
        handler. I'd prefer hard a reference:

        - --------------------------------------------------------
        use POSIX;

        my $sigset = POSIX::SigSet->new();
        my $action = POSIX::SigAction->new(
        sub {
        warn "got SIGUSR2\n";
        },
        $sigset,
        &POSIX::SA_NODEFER,
        );

        POSIX::sigaction(&POSIX::SIGUSR2, $action);
        - --------------------------------------------------------

        but if you want to use a symbolic reference explicitly mention the package:

        - --------------------------------------------------------
        use POSIX;

        my $sigset = POSIX::SigSet->new();
        my $action = POSIX::SigAction->new(
        'X::sighnd',
        $sigset,
        &POSIX::SA_NODEFER,
        );

        sub X::sighnd {
        warn "got SIGUSR2\n";
        }

        POSIX::sigaction(&POSIX::SIGUSR2, $action);
        - --------------------------------------------------------

        Torsten
        -----BEGIN PGP SIGNATURE-----
        Version: GnuPG v1.0.7 (GNU/Linux)

        iD8DBQE//RYqwicyCTir8T4RAnREAJ9KBNc8dduIsxXZVSZJATNtshLn2ACffnqr
        maIBXdsH1skwYEBBpE+WE/4=
        =rH3W
        -----END PGP SIGNATURE-----

        --
        Reporting bugs: http://perl.apache.org/bugs/
        Mail list info: http://perl.apache.org/maillist/modperl.html
      Your message has been successfully submitted and would be delivered to recipients shortly.