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.










share|improve this question
























  • nohup itself is the child process
    – frostschutz
    Nov 26 at 22:24

















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.










share|improve this question
























  • nohup itself is the child process
    – frostschutz
    Nov 26 at 22:24















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.










share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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




















  • 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












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.






share|improve this answer























  • 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










  • 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










  • Thanks. Guru Stephen, may I call your attention to unix.stackexchange.com/questions/484344/…
    – Tim
    Nov 27 at 14:50











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















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

























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.






share|improve this answer























  • 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










  • 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










  • Thanks. Guru Stephen, may I call your attention to unix.stackexchange.com/questions/484344/…
    – Tim
    Nov 27 at 14:50















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.






share|improve this answer























  • 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










  • 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










  • Thanks. Guru Stephen, may I call your attention to unix.stackexchange.com/questions/484344/…
    – Tim
    Nov 27 at 14:50













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.






share|improve this answer














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.







share|improve this answer














share|improve this answer



share|improve this answer








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 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










  • 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










  • 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












  • 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










  • 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. "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


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

サソリ

広島県道265号伴広島線

Setup Asymptote in Texstudio