Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perlipc code example with exec inside signal handler #13352

Open
p5pRT opened this issue Oct 17, 2013 · 3 comments
Open

perlipc code example with exec inside signal handler #13352

p5pRT opened this issue Oct 17, 2013 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Oct 17, 2013

Migrated from rt.perl.org#120256 (status was 'open')

Searchable as RT120256$

@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2013

From victor@vsespb.ru

This example is broken​:
http​://perldoc.perl.org/perlipc.html#Handling-the-SIGHUP-Signal-in-Daemons

it only works for first SIGHUP.

looks like it's because this issue
http​://www.nntp.perl.org/group/perl.perl5.porters/2000/01/msg5237.html
more investagations and workarounds here​:
http​://www.perlmonks.org/?node_id=1058565

I can fix the example by setting flag in signal handler, and calling exec
outside of handler, but probably there are better fixes with
POSIX​::SigAction etc which I am not familar with.

@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2013

From @Leont

On Thu, Oct 17, 2013 at 7​:29 PM, Victor Efimov <perlbug-followup@​perl.org>wrote​:

# New Ticket Created by Victor Efimov
# Please include the string​: [perl #120256]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=120256 >

This example is broken​:
http​://perldoc.perl.org/perlipc.html#Handling-the-SIGHUP-Signal-in-Daemons

it only works for first SIGHUP.

looks like it's because this issue
http​://www.nntp.perl.org/group/perl.perl5.porters/2000/01/msg5237.html
more investagations and workarounds here​:
http​://www.perlmonks.org/?node_id=1058565

I can fix the example by setting flag in signal handler, and calling exec
outside of handler, but probably there are better fixes with
POSIX​::SigAction etc which I am not familar with.

This example is broken​:
http​://perldoc.perl.org/perlipc.html#Handling-the-SIGHUP-Signal-in-Daemons

it only works for first SIGHUP.

looks like it's because this issue
http​://www.nntp.perl.org/group/perl.perl5.porters/2000/01/msg5237.html
more investagations and workarounds here​:
http​://www.perlmonks.org/?node_id=1058565

I can fix the example by setting flag in signal handler, and calling exec
outside of handler, but probably there are better fixes with
POSIX​::SigAction etc which I am not familar with.

Right, this makes sense.

During the signal handler, the signal is temporarily blocked. On exec, the
new process inherits this block.

Actually the proposed fix sucks too (it uses an unsafe signal handler);
possibly a better approach is to unblock it before the exec call.

Leon

@p5pRT
Copy link
Author

p5pRT commented Oct 17, 2013

The RT System itself - Status changed from 'new' to 'open'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants