Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(36)

Issue 7308102: code review 7308102: runtime: fix running under nohup (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 2 months ago by rsc
Modified:
12 years, 2 months ago
Reviewers:
CC:
golang-dev, mikio, iant
Visibility:
Public.

Description

runtime: fix running under nohup There are two ways nohup(1) might be implemented: it might mask away the signal, or it might set the handler to SIG_IGN, both of which are inherited across fork+exec. So two fixes: * Make sure to preserve the inherited signal mask at minit instead of clearing it. * If the SIGHUP handler is SIG_IGN, leave it that way. Fixes issue 4491.

Patch Set 1 #

Patch Set 2 : diff -r 90e25d15bc1c https://code.google.com/p/go/ #

Patch Set 3 : diff -r 90e25d15bc1c https://code.google.com/p/go/ #

Total comments: 2

Patch Set 4 : diff -r e1a94ec9f285 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+145 lines, -13 lines) Patch
M src/pkg/runtime/os_darwin.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/os_freebsd.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/os_linux.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/os_netbsd.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/os_openbsd.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/signal_darwin_386.c View 1 1 chunk +9 lines, -0 lines 0 comments Download
M src/pkg/runtime/signal_darwin_amd64.c View 1 1 chunk +9 lines, -0 lines 0 comments Download
M src/pkg/runtime/signal_freebsd_386.c View 1 1 chunk +9 lines, -0 lines 0 comments Download
M src/pkg/runtime/signal_freebsd_amd64.c View 1 1 chunk +9 lines, -0 lines 0 comments Download
M src/pkg/runtime/signal_freebsd_arm.c View 1 1 chunk +9 lines, -0 lines 0 comments Download
M src/pkg/runtime/signal_linux_386.c View 1 1 chunk +9 lines, -0 lines 0 comments Download
M src/pkg/runtime/signal_linux_amd64.c View 1 1 chunk +9 lines, -0 lines 0 comments Download
M src/pkg/runtime/signal_linux_arm.c View 1 1 chunk +9 lines, -0 lines 0 comments Download
M src/pkg/runtime/signal_netbsd_386.c View 1 1 chunk +9 lines, -0 lines 0 comments Download
M src/pkg/runtime/signal_netbsd_amd64.c View 1 1 chunk +9 lines, -0 lines 0 comments Download
M src/pkg/runtime/signal_netbsd_arm.c View 1 1 chunk +9 lines, -0 lines 0 comments Download
M src/pkg/runtime/signal_openbsd_386.c View 1 1 chunk +9 lines, -0 lines 0 comments Download
M src/pkg/runtime/signal_openbsd_amd64.c View 1 1 chunk +9 lines, -0 lines 0 comments Download
M src/pkg/runtime/thread_darwin.c View 1 3 chunks +5 lines, -5 lines 0 comments Download
M src/pkg/runtime/thread_freebsd.c View 1 3 chunks +4 lines, -2 lines 0 comments Download
M src/pkg/runtime/thread_linux.c View 1 3 chunks +4 lines, -2 lines 0 comments Download
M src/pkg/runtime/thread_netbsd.c View 1 3 chunks +5 lines, -2 lines 0 comments Download
M src/pkg/runtime/thread_openbsd.c View 1 3 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 6
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
12 years, 2 months ago (2013-02-15 05:49:36 UTC) #1
mikio
https://codereview.appspot.com/7308102/diff/4001/src/pkg/runtime/signal_freebsd_amd64.c File src/pkg/runtime/signal_freebsd_amd64.c (right): https://codereview.appspot.com/7308102/diff/4001/src/pkg/runtime/signal_freebsd_amd64.c#newcode141 src/pkg/runtime/signal_freebsd_amd64.c:141: if(i == SIGHUP) { perhaps you mean; if(m != ...
12 years, 2 months ago (2013-02-15 09:04:57 UTC) #2
mikio
runtime+cgo test still fails on freebsd, hm.
12 years, 2 months ago (2013-02-15 09:10:33 UTC) #3
iant
LGTM
12 years, 2 months ago (2013-02-15 15:56:09 UTC) #4
rsc
FWIW I do expect this to break on some systems. That's what the dashboard is ...
12 years, 2 months ago (2013-02-15 16:00:45 UTC) #5
rsc
12 years, 2 months ago (2013-02-15 16:19:05 UTC) #6
*** Submitted as https://code.google.com/p/go/source/detail?r=a61065d9bf0b ***

runtime: fix running under nohup

There are two ways nohup(1) might be implemented:
it might mask away the signal, or it might set the handler
to SIG_IGN, both of which are inherited across fork+exec.
So two fixes:

* Make sure to preserve the inherited signal mask at
minit instead of clearing it.

* If the SIGHUP handler is SIG_IGN, leave it that way.

Fixes issue 4491.

R=golang-dev, mikioh.mikioh, iant
CC=golang-dev
https://codereview.appspot.com/7308102
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b