Does nohup apply only to a child process of a shell process, but not to a child process of a non-shell...
up vote
0
down vote
favorite
nohup is an external program. How can it change the action of SIGHUP by a child process of a shell process to be "ignore"? (in terms of some arguments when the child process invokes fork()
and/or execve()
on the program which follows nohup?)
Does nohup apply only to a child process of a shell process, but not to a child process of a non-shell process?
Thanks.
nohup sighup
add a comment |
up vote
0
down vote
favorite
nohup is an external program. How can it change the action of SIGHUP by a child process of a shell process to be "ignore"? (in terms of some arguments when the child process invokes fork()
and/or execve()
on the program which follows nohup?)
Does nohup apply only to a child process of a shell process, but not to a child process of a non-shell process?
Thanks.
nohup sighup
nohup itself is the child process
– frostschutz
Nov 26 at 22:24
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
nohup is an external program. How can it change the action of SIGHUP by a child process of a shell process to be "ignore"? (in terms of some arguments when the child process invokes fork()
and/or execve()
on the program which follows nohup?)
Does nohup apply only to a child process of a shell process, but not to a child process of a non-shell process?
Thanks.
nohup sighup
nohup is an external program. How can it change the action of SIGHUP by a child process of a shell process to be "ignore"? (in terms of some arguments when the child process invokes fork()
and/or execve()
on the program which follows nohup?)
Does nohup apply only to a child process of a shell process, but not to a child process of a non-shell process?
Thanks.
nohup sighup
nohup sighup
edited Nov 26 at 21:49
asked Nov 26 at 21:40
Tim
25.1k72243441
25.1k72243441
nohup itself is the child process
– frostschutz
Nov 26 at 22:24
add a comment |
nohup itself is the child process
– frostschutz
Nov 26 at 22:24
nohup itself is the child process
– frostschutz
Nov 26 at 22:24
nohup itself is the child process
– frostschutz
Nov 26 at 22:24
add a comment |
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
nohup
configures itself to ignore the SIGHUP
signal; see for example the GNU implementation. The POSIX specification for nohup
states that
At the time the named utility is invoked, the SIGHUP signal shall be set to be ignored.
As also specified by POSIX, child processes inherit ignored signals other than SIGCHLD
, so any process started by nohup
after it’s ignored SIGHUP
will itself ignore SIGHUP
.
nohup
’s handling applies to any child of nohup
, regardless of nohup
’s parent process. nohup
does not (nor can it) affect the way signals are handled by any of its parents, whether they’re shells or not.
Thanks. "child processes inherit ignored signals other than SIGCHLD, so any process started by nohup after it’s ignored SIGHUP will itself ignore SIGHUP." Is this specified as some argument toexecve()
?
– Tim
Nov 26 at 22:07
No, it’s how all theexec
functions are specified, in all cases. There is noexec
argument you can use to change that.
– Stephen Kitt
Nov 26 at 22:13
Is it that way only for implementing nohup?
– Tim
Nov 26 at 22:16
I suspect thatnohup
was taken into consideration when that part of POSIX was written, but it wasn’t the only consideration; see the rationale section onexec
for details.
– Stephen Kitt
Nov 26 at 22:23
Thanks. Guru Stephen, may I call your attention to unix.stackexchange.com/questions/484344/…
– Tim
Nov 27 at 14:50
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
nohup
configures itself to ignore the SIGHUP
signal; see for example the GNU implementation. The POSIX specification for nohup
states that
At the time the named utility is invoked, the SIGHUP signal shall be set to be ignored.
As also specified by POSIX, child processes inherit ignored signals other than SIGCHLD
, so any process started by nohup
after it’s ignored SIGHUP
will itself ignore SIGHUP
.
nohup
’s handling applies to any child of nohup
, regardless of nohup
’s parent process. nohup
does not (nor can it) affect the way signals are handled by any of its parents, whether they’re shells or not.
Thanks. "child processes inherit ignored signals other than SIGCHLD, so any process started by nohup after it’s ignored SIGHUP will itself ignore SIGHUP." Is this specified as some argument toexecve()
?
– Tim
Nov 26 at 22:07
No, it’s how all theexec
functions are specified, in all cases. There is noexec
argument you can use to change that.
– Stephen Kitt
Nov 26 at 22:13
Is it that way only for implementing nohup?
– Tim
Nov 26 at 22:16
I suspect thatnohup
was taken into consideration when that part of POSIX was written, but it wasn’t the only consideration; see the rationale section onexec
for details.
– Stephen Kitt
Nov 26 at 22:23
Thanks. Guru Stephen, may I call your attention to unix.stackexchange.com/questions/484344/…
– Tim
Nov 27 at 14:50
add a comment |
up vote
3
down vote
accepted
nohup
configures itself to ignore the SIGHUP
signal; see for example the GNU implementation. The POSIX specification for nohup
states that
At the time the named utility is invoked, the SIGHUP signal shall be set to be ignored.
As also specified by POSIX, child processes inherit ignored signals other than SIGCHLD
, so any process started by nohup
after it’s ignored SIGHUP
will itself ignore SIGHUP
.
nohup
’s handling applies to any child of nohup
, regardless of nohup
’s parent process. nohup
does not (nor can it) affect the way signals are handled by any of its parents, whether they’re shells or not.
Thanks. "child processes inherit ignored signals other than SIGCHLD, so any process started by nohup after it’s ignored SIGHUP will itself ignore SIGHUP." Is this specified as some argument toexecve()
?
– Tim
Nov 26 at 22:07
No, it’s how all theexec
functions are specified, in all cases. There is noexec
argument you can use to change that.
– Stephen Kitt
Nov 26 at 22:13
Is it that way only for implementing nohup?
– Tim
Nov 26 at 22:16
I suspect thatnohup
was taken into consideration when that part of POSIX was written, but it wasn’t the only consideration; see the rationale section onexec
for details.
– Stephen Kitt
Nov 26 at 22:23
Thanks. Guru Stephen, may I call your attention to unix.stackexchange.com/questions/484344/…
– Tim
Nov 27 at 14:50
add a comment |
up vote
3
down vote
accepted
up vote
3
down vote
accepted
nohup
configures itself to ignore the SIGHUP
signal; see for example the GNU implementation. The POSIX specification for nohup
states that
At the time the named utility is invoked, the SIGHUP signal shall be set to be ignored.
As also specified by POSIX, child processes inherit ignored signals other than SIGCHLD
, so any process started by nohup
after it’s ignored SIGHUP
will itself ignore SIGHUP
.
nohup
’s handling applies to any child of nohup
, regardless of nohup
’s parent process. nohup
does not (nor can it) affect the way signals are handled by any of its parents, whether they’re shells or not.
nohup
configures itself to ignore the SIGHUP
signal; see for example the GNU implementation. The POSIX specification for nohup
states that
At the time the named utility is invoked, the SIGHUP signal shall be set to be ignored.
As also specified by POSIX, child processes inherit ignored signals other than SIGCHLD
, so any process started by nohup
after it’s ignored SIGHUP
will itself ignore SIGHUP
.
nohup
’s handling applies to any child of nohup
, regardless of nohup
’s parent process. nohup
does not (nor can it) affect the way signals are handled by any of its parents, whether they’re shells or not.
edited Nov 26 at 22:20
answered Nov 26 at 21:57
Stephen Kitt
159k24353428
159k24353428
Thanks. "child processes inherit ignored signals other than SIGCHLD, so any process started by nohup after it’s ignored SIGHUP will itself ignore SIGHUP." Is this specified as some argument toexecve()
?
– Tim
Nov 26 at 22:07
No, it’s how all theexec
functions are specified, in all cases. There is noexec
argument you can use to change that.
– Stephen Kitt
Nov 26 at 22:13
Is it that way only for implementing nohup?
– Tim
Nov 26 at 22:16
I suspect thatnohup
was taken into consideration when that part of POSIX was written, but it wasn’t the only consideration; see the rationale section onexec
for details.
– Stephen Kitt
Nov 26 at 22:23
Thanks. Guru Stephen, may I call your attention to unix.stackexchange.com/questions/484344/…
– Tim
Nov 27 at 14:50
add a comment |
Thanks. "child processes inherit ignored signals other than SIGCHLD, so any process started by nohup after it’s ignored SIGHUP will itself ignore SIGHUP." Is this specified as some argument toexecve()
?
– Tim
Nov 26 at 22:07
No, it’s how all theexec
functions are specified, in all cases. There is noexec
argument you can use to change that.
– Stephen Kitt
Nov 26 at 22:13
Is it that way only for implementing nohup?
– Tim
Nov 26 at 22:16
I suspect thatnohup
was taken into consideration when that part of POSIX was written, but it wasn’t the only consideration; see the rationale section onexec
for details.
– Stephen Kitt
Nov 26 at 22:23
Thanks. Guru Stephen, may I call your attention to unix.stackexchange.com/questions/484344/…
– Tim
Nov 27 at 14:50
Thanks. "child processes inherit ignored signals other than SIGCHLD, so any process started by nohup after it’s ignored SIGHUP will itself ignore SIGHUP." Is this specified as some argument to
execve()
?– Tim
Nov 26 at 22:07
Thanks. "child processes inherit ignored signals other than SIGCHLD, so any process started by nohup after it’s ignored SIGHUP will itself ignore SIGHUP." Is this specified as some argument to
execve()
?– Tim
Nov 26 at 22:07
No, it’s how all the
exec
functions are specified, in all cases. There is no exec
argument you can use to change that.– Stephen Kitt
Nov 26 at 22:13
No, it’s how all the
exec
functions are specified, in all cases. There is no exec
argument you can use to change that.– Stephen Kitt
Nov 26 at 22:13
Is it that way only for implementing nohup?
– Tim
Nov 26 at 22:16
Is it that way only for implementing nohup?
– Tim
Nov 26 at 22:16
I suspect that
nohup
was taken into consideration when that part of POSIX was written, but it wasn’t the only consideration; see the rationale section on exec
for details.– Stephen Kitt
Nov 26 at 22:23
I suspect that
nohup
was taken into consideration when that part of POSIX was written, but it wasn’t the only consideration; see the rationale section on exec
for details.– Stephen Kitt
Nov 26 at 22:23
Thanks. Guru Stephen, may I call your attention to unix.stackexchange.com/questions/484344/…
– Tim
Nov 27 at 14:50
Thanks. Guru Stephen, may I call your attention to unix.stackexchange.com/questions/484344/…
– Tim
Nov 27 at 14:50
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f484308%2fdoes-nohup-apply-only-to-a-child-process-of-a-shell-process-but-not-to-a-child%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
nohup itself is the child process
– frostschutz
Nov 26 at 22:24