Do `disown -h` and `nohup` work effectively the same?











up vote
15
down vote

favorite
1












disown




  • causes a shell not to send SIGHUP to its disowned job when the shell terminates, and


  • removes the disowned job from the shell's job control.



Is the first the result of the second?
In other words, if a process started from a shell is removed from the shell's job control by any way, will the shell not send SIGHUP to the process when the shell terminates?



disown -h still keeps a process under a shell's job control. Does it mean that disown -h makes a process still receives SIGHUP sent from the shell, but sets up the action of SIGHUP by the process to be "ignore"? That sounds similar to nohup.



$ sleep 123 & disown -h
[1] 26103
$ jobs
[1]+ Running sleep 123 &
$ fg 1
sleep 123
$ ^Z
[1]+ Stopped sleep 125
$ bg 1
[1]+ sleep 123 &
$ exit

$ ps aux | grep sleep
t 26103 0.0 0.0 14584 824 ? S 15:19 0:00 sleep 123


Do disown -h and nohup work effectively the same, if we disregard their difference in using a terminal?



Thanks.










share|improve this question
























  • Another difference not discussed here is that if you aren't using nohup, you need to redirect stdin/stdout/stderr away from the TTY (should your original shell be connected to one) yourself. (OTOH, I actually consider that better practice than relying on an egregious hardcoded default like ./nohup.out).
    – Charles Duffy
    Nov 26 at 22:17

















up vote
15
down vote

favorite
1












disown




  • causes a shell not to send SIGHUP to its disowned job when the shell terminates, and


  • removes the disowned job from the shell's job control.



Is the first the result of the second?
In other words, if a process started from a shell is removed from the shell's job control by any way, will the shell not send SIGHUP to the process when the shell terminates?



disown -h still keeps a process under a shell's job control. Does it mean that disown -h makes a process still receives SIGHUP sent from the shell, but sets up the action of SIGHUP by the process to be "ignore"? That sounds similar to nohup.



$ sleep 123 & disown -h
[1] 26103
$ jobs
[1]+ Running sleep 123 &
$ fg 1
sleep 123
$ ^Z
[1]+ Stopped sleep 125
$ bg 1
[1]+ sleep 123 &
$ exit

$ ps aux | grep sleep
t 26103 0.0 0.0 14584 824 ? S 15:19 0:00 sleep 123


Do disown -h and nohup work effectively the same, if we disregard their difference in using a terminal?



Thanks.










share|improve this question
























  • Another difference not discussed here is that if you aren't using nohup, you need to redirect stdin/stdout/stderr away from the TTY (should your original shell be connected to one) yourself. (OTOH, I actually consider that better practice than relying on an egregious hardcoded default like ./nohup.out).
    – Charles Duffy
    Nov 26 at 22:17















up vote
15
down vote

favorite
1









up vote
15
down vote

favorite
1






1





disown




  • causes a shell not to send SIGHUP to its disowned job when the shell terminates, and


  • removes the disowned job from the shell's job control.



Is the first the result of the second?
In other words, if a process started from a shell is removed from the shell's job control by any way, will the shell not send SIGHUP to the process when the shell terminates?



disown -h still keeps a process under a shell's job control. Does it mean that disown -h makes a process still receives SIGHUP sent from the shell, but sets up the action of SIGHUP by the process to be "ignore"? That sounds similar to nohup.



$ sleep 123 & disown -h
[1] 26103
$ jobs
[1]+ Running sleep 123 &
$ fg 1
sleep 123
$ ^Z
[1]+ Stopped sleep 125
$ bg 1
[1]+ sleep 123 &
$ exit

$ ps aux | grep sleep
t 26103 0.0 0.0 14584 824 ? S 15:19 0:00 sleep 123


Do disown -h and nohup work effectively the same, if we disregard their difference in using a terminal?



Thanks.










share|improve this question















disown




  • causes a shell not to send SIGHUP to its disowned job when the shell terminates, and


  • removes the disowned job from the shell's job control.



Is the first the result of the second?
In other words, if a process started from a shell is removed from the shell's job control by any way, will the shell not send SIGHUP to the process when the shell terminates?



disown -h still keeps a process under a shell's job control. Does it mean that disown -h makes a process still receives SIGHUP sent from the shell, but sets up the action of SIGHUP by the process to be "ignore"? That sounds similar to nohup.



$ sleep 123 & disown -h
[1] 26103
$ jobs
[1]+ Running sleep 123 &
$ fg 1
sleep 123
$ ^Z
[1]+ Stopped sleep 125
$ bg 1
[1]+ sleep 123 &
$ exit

$ ps aux | grep sleep
t 26103 0.0 0.0 14584 824 ? S 15:19 0:00 sleep 123


Do disown -h and nohup work effectively the same, if we disregard their difference in using a terminal?



Thanks.







bash nohup disown






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 26 at 22:24

























asked Nov 26 at 19:48









Tim

25.2k72243444




25.2k72243444












  • Another difference not discussed here is that if you aren't using nohup, you need to redirect stdin/stdout/stderr away from the TTY (should your original shell be connected to one) yourself. (OTOH, I actually consider that better practice than relying on an egregious hardcoded default like ./nohup.out).
    – Charles Duffy
    Nov 26 at 22:17




















  • Another difference not discussed here is that if you aren't using nohup, you need to redirect stdin/stdout/stderr away from the TTY (should your original shell be connected to one) yourself. (OTOH, I actually consider that better practice than relying on an egregious hardcoded default like ./nohup.out).
    – Charles Duffy
    Nov 26 at 22:17


















Another difference not discussed here is that if you aren't using nohup, you need to redirect stdin/stdout/stderr away from the TTY (should your original shell be connected to one) yourself. (OTOH, I actually consider that better practice than relying on an egregious hardcoded default like ./nohup.out).
– Charles Duffy
Nov 26 at 22:17






Another difference not discussed here is that if you aren't using nohup, you need to redirect stdin/stdout/stderr away from the TTY (should your original shell be connected to one) yourself. (OTOH, I actually consider that better practice than relying on an egregious hardcoded default like ./nohup.out).
– Charles Duffy
Nov 26 at 22:17












2 Answers
2






active

oldest

votes

















up vote
19
down vote













nohup and disown -h are not exactly the same thing.



With disown, a process is removed from the list of jobs in the current interactive shell. Running jobs after starting a background process and running disown will not show that process as a job in the shell. A disowned job will not receive a HUP from the shell when it exits (but see note at end).



With disown -h, the job is not removed from the list of jobs, but the shell would not send a HUP signal to it if it exited (but see note at end).



The nohup utility ignores the HUP signal and starts the given utility. The utility inherits the signal mask from nohup and will therefore also ignore the HUP signal. When the shell terminates, the process remains as a child process of nohup (and nohup is re-parented to init).



The difference is that the process started with nohup ignores HUP regardless of who sends the signal. The disowned processes are just not sent a HUP signal by the shell, but may still be sent the signal from e.g. kill -s HUP <pid> and will not ignore this.



Note that HUP is only sent to the jobs of a shell if




  • the shell is a login shell and the huponexit shell option is set, or

  • the shell itself recieves a HUP signal.


Relevant bits from the bash manual (my emphasis):




SIGNALS



[...]



The shell exits by default upon receipt of a SIGHUP. Before exiting,
an interactive shell resends the SIGHUP to all jobs, running or
stopped. Stopped jobs are sent SIGCONT to ensure that they receive the
SIGHUP. To prevent the shell from sending the signal to a particular
job, it should be removed from the jobs table with the disown builtin
(see SHELL BUILTIN COMMANDS below) or marked to not receive SIGHUP
using disown -h.



If the huponexit shell option has been set with shopt, bash sends a
SIGHUP to all jobs when an interactive login shell exits.







disown [-ar] [-h] [jobspec ... | pid ... ]



Without options, remove each jobspec from the table of active
jobs. [...] If the -h option
is given, each jobspec is not removed from the table, but is
marked so that SIGHUP is not sent to the job if the shell
receives a SIGHUP
. [...]




Related:




  • Difference between nohup, disown and &






share|improve this answer























  • I get bash: disown: nohup: no such job and same for sleep and 5 from disown nohup sleep 5 &. What did you mean by that second command from the last sentence?
    – Ruslan
    Nov 26 at 20:54










  • @Ruslan Yes I'm missing a & in there (and the order of nohup and disown was also wrong). Thanks. Will update now.
    – Kusalananda
    Nov 26 at 20:55












  • For example, unix.stackexchange.com/questions/484315/…
    – Tim
    Nov 26 at 22:30










  • @Tim Sorry for the excessive editing of the answer. It took a while to get my head around it. I'm done now.
    – Kusalananda
    Nov 26 at 23:04










  • Thanks. disown makes a shell not sent SIGHUP to a child by removing the child from the shell's job list. How does disown -h achieve the same?
    – Tim
    Nov 26 at 23:14




















up vote
4
down vote













They are Different:




  • disown removes the job from the active jobs table. Then continues on with current job. With -h the proccess is NOT sent SIGHUP. It is instead left to die with the shell that contains it, when it recieves a SIGHUP.



  • nohup ignores the HUP. Then anything that would have been passed to the terminal by the proccess closing instead goes to a file nohup.out.




    nohup is defined by POSIX while disown is not.









share|improve this answer





















    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%2f484276%2fdo-disown-h-and-nohup-work-effectively-the-same%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    19
    down vote













    nohup and disown -h are not exactly the same thing.



    With disown, a process is removed from the list of jobs in the current interactive shell. Running jobs after starting a background process and running disown will not show that process as a job in the shell. A disowned job will not receive a HUP from the shell when it exits (but see note at end).



    With disown -h, the job is not removed from the list of jobs, but the shell would not send a HUP signal to it if it exited (but see note at end).



    The nohup utility ignores the HUP signal and starts the given utility. The utility inherits the signal mask from nohup and will therefore also ignore the HUP signal. When the shell terminates, the process remains as a child process of nohup (and nohup is re-parented to init).



    The difference is that the process started with nohup ignores HUP regardless of who sends the signal. The disowned processes are just not sent a HUP signal by the shell, but may still be sent the signal from e.g. kill -s HUP <pid> and will not ignore this.



    Note that HUP is only sent to the jobs of a shell if




    • the shell is a login shell and the huponexit shell option is set, or

    • the shell itself recieves a HUP signal.


    Relevant bits from the bash manual (my emphasis):




    SIGNALS



    [...]



    The shell exits by default upon receipt of a SIGHUP. Before exiting,
    an interactive shell resends the SIGHUP to all jobs, running or
    stopped. Stopped jobs are sent SIGCONT to ensure that they receive the
    SIGHUP. To prevent the shell from sending the signal to a particular
    job, it should be removed from the jobs table with the disown builtin
    (see SHELL BUILTIN COMMANDS below) or marked to not receive SIGHUP
    using disown -h.



    If the huponexit shell option has been set with shopt, bash sends a
    SIGHUP to all jobs when an interactive login shell exits.







    disown [-ar] [-h] [jobspec ... | pid ... ]



    Without options, remove each jobspec from the table of active
    jobs. [...] If the -h option
    is given, each jobspec is not removed from the table, but is
    marked so that SIGHUP is not sent to the job if the shell
    receives a SIGHUP
    . [...]




    Related:




    • Difference between nohup, disown and &






    share|improve this answer























    • I get bash: disown: nohup: no such job and same for sleep and 5 from disown nohup sleep 5 &. What did you mean by that second command from the last sentence?
      – Ruslan
      Nov 26 at 20:54










    • @Ruslan Yes I'm missing a & in there (and the order of nohup and disown was also wrong). Thanks. Will update now.
      – Kusalananda
      Nov 26 at 20:55












    • For example, unix.stackexchange.com/questions/484315/…
      – Tim
      Nov 26 at 22:30










    • @Tim Sorry for the excessive editing of the answer. It took a while to get my head around it. I'm done now.
      – Kusalananda
      Nov 26 at 23:04










    • Thanks. disown makes a shell not sent SIGHUP to a child by removing the child from the shell's job list. How does disown -h achieve the same?
      – Tim
      Nov 26 at 23:14

















    up vote
    19
    down vote













    nohup and disown -h are not exactly the same thing.



    With disown, a process is removed from the list of jobs in the current interactive shell. Running jobs after starting a background process and running disown will not show that process as a job in the shell. A disowned job will not receive a HUP from the shell when it exits (but see note at end).



    With disown -h, the job is not removed from the list of jobs, but the shell would not send a HUP signal to it if it exited (but see note at end).



    The nohup utility ignores the HUP signal and starts the given utility. The utility inherits the signal mask from nohup and will therefore also ignore the HUP signal. When the shell terminates, the process remains as a child process of nohup (and nohup is re-parented to init).



    The difference is that the process started with nohup ignores HUP regardless of who sends the signal. The disowned processes are just not sent a HUP signal by the shell, but may still be sent the signal from e.g. kill -s HUP <pid> and will not ignore this.



    Note that HUP is only sent to the jobs of a shell if




    • the shell is a login shell and the huponexit shell option is set, or

    • the shell itself recieves a HUP signal.


    Relevant bits from the bash manual (my emphasis):




    SIGNALS



    [...]



    The shell exits by default upon receipt of a SIGHUP. Before exiting,
    an interactive shell resends the SIGHUP to all jobs, running or
    stopped. Stopped jobs are sent SIGCONT to ensure that they receive the
    SIGHUP. To prevent the shell from sending the signal to a particular
    job, it should be removed from the jobs table with the disown builtin
    (see SHELL BUILTIN COMMANDS below) or marked to not receive SIGHUP
    using disown -h.



    If the huponexit shell option has been set with shopt, bash sends a
    SIGHUP to all jobs when an interactive login shell exits.







    disown [-ar] [-h] [jobspec ... | pid ... ]



    Without options, remove each jobspec from the table of active
    jobs. [...] If the -h option
    is given, each jobspec is not removed from the table, but is
    marked so that SIGHUP is not sent to the job if the shell
    receives a SIGHUP
    . [...]




    Related:




    • Difference between nohup, disown and &






    share|improve this answer























    • I get bash: disown: nohup: no such job and same for sleep and 5 from disown nohup sleep 5 &. What did you mean by that second command from the last sentence?
      – Ruslan
      Nov 26 at 20:54










    • @Ruslan Yes I'm missing a & in there (and the order of nohup and disown was also wrong). Thanks. Will update now.
      – Kusalananda
      Nov 26 at 20:55












    • For example, unix.stackexchange.com/questions/484315/…
      – Tim
      Nov 26 at 22:30










    • @Tim Sorry for the excessive editing of the answer. It took a while to get my head around it. I'm done now.
      – Kusalananda
      Nov 26 at 23:04










    • Thanks. disown makes a shell not sent SIGHUP to a child by removing the child from the shell's job list. How does disown -h achieve the same?
      – Tim
      Nov 26 at 23:14















    up vote
    19
    down vote










    up vote
    19
    down vote









    nohup and disown -h are not exactly the same thing.



    With disown, a process is removed from the list of jobs in the current interactive shell. Running jobs after starting a background process and running disown will not show that process as a job in the shell. A disowned job will not receive a HUP from the shell when it exits (but see note at end).



    With disown -h, the job is not removed from the list of jobs, but the shell would not send a HUP signal to it if it exited (but see note at end).



    The nohup utility ignores the HUP signal and starts the given utility. The utility inherits the signal mask from nohup and will therefore also ignore the HUP signal. When the shell terminates, the process remains as a child process of nohup (and nohup is re-parented to init).



    The difference is that the process started with nohup ignores HUP regardless of who sends the signal. The disowned processes are just not sent a HUP signal by the shell, but may still be sent the signal from e.g. kill -s HUP <pid> and will not ignore this.



    Note that HUP is only sent to the jobs of a shell if




    • the shell is a login shell and the huponexit shell option is set, or

    • the shell itself recieves a HUP signal.


    Relevant bits from the bash manual (my emphasis):




    SIGNALS



    [...]



    The shell exits by default upon receipt of a SIGHUP. Before exiting,
    an interactive shell resends the SIGHUP to all jobs, running or
    stopped. Stopped jobs are sent SIGCONT to ensure that they receive the
    SIGHUP. To prevent the shell from sending the signal to a particular
    job, it should be removed from the jobs table with the disown builtin
    (see SHELL BUILTIN COMMANDS below) or marked to not receive SIGHUP
    using disown -h.



    If the huponexit shell option has been set with shopt, bash sends a
    SIGHUP to all jobs when an interactive login shell exits.







    disown [-ar] [-h] [jobspec ... | pid ... ]



    Without options, remove each jobspec from the table of active
    jobs. [...] If the -h option
    is given, each jobspec is not removed from the table, but is
    marked so that SIGHUP is not sent to the job if the shell
    receives a SIGHUP
    . [...]




    Related:




    • Difference between nohup, disown and &






    share|improve this answer














    nohup and disown -h are not exactly the same thing.



    With disown, a process is removed from the list of jobs in the current interactive shell. Running jobs after starting a background process and running disown will not show that process as a job in the shell. A disowned job will not receive a HUP from the shell when it exits (but see note at end).



    With disown -h, the job is not removed from the list of jobs, but the shell would not send a HUP signal to it if it exited (but see note at end).



    The nohup utility ignores the HUP signal and starts the given utility. The utility inherits the signal mask from nohup and will therefore also ignore the HUP signal. When the shell terminates, the process remains as a child process of nohup (and nohup is re-parented to init).



    The difference is that the process started with nohup ignores HUP regardless of who sends the signal. The disowned processes are just not sent a HUP signal by the shell, but may still be sent the signal from e.g. kill -s HUP <pid> and will not ignore this.



    Note that HUP is only sent to the jobs of a shell if




    • the shell is a login shell and the huponexit shell option is set, or

    • the shell itself recieves a HUP signal.


    Relevant bits from the bash manual (my emphasis):




    SIGNALS



    [...]



    The shell exits by default upon receipt of a SIGHUP. Before exiting,
    an interactive shell resends the SIGHUP to all jobs, running or
    stopped. Stopped jobs are sent SIGCONT to ensure that they receive the
    SIGHUP. To prevent the shell from sending the signal to a particular
    job, it should be removed from the jobs table with the disown builtin
    (see SHELL BUILTIN COMMANDS below) or marked to not receive SIGHUP
    using disown -h.



    If the huponexit shell option has been set with shopt, bash sends a
    SIGHUP to all jobs when an interactive login shell exits.







    disown [-ar] [-h] [jobspec ... | pid ... ]



    Without options, remove each jobspec from the table of active
    jobs. [...] If the -h option
    is given, each jobspec is not removed from the table, but is
    marked so that SIGHUP is not sent to the job if the shell
    receives a SIGHUP
    . [...]




    Related:




    • Difference between nohup, disown and &







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Nov 26 at 23:08

























    answered Nov 26 at 20:05









    Kusalananda

    118k16223363




    118k16223363












    • I get bash: disown: nohup: no such job and same for sleep and 5 from disown nohup sleep 5 &. What did you mean by that second command from the last sentence?
      – Ruslan
      Nov 26 at 20:54










    • @Ruslan Yes I'm missing a & in there (and the order of nohup and disown was also wrong). Thanks. Will update now.
      – Kusalananda
      Nov 26 at 20:55












    • For example, unix.stackexchange.com/questions/484315/…
      – Tim
      Nov 26 at 22:30










    • @Tim Sorry for the excessive editing of the answer. It took a while to get my head around it. I'm done now.
      – Kusalananda
      Nov 26 at 23:04










    • Thanks. disown makes a shell not sent SIGHUP to a child by removing the child from the shell's job list. How does disown -h achieve the same?
      – Tim
      Nov 26 at 23:14




















    • I get bash: disown: nohup: no such job and same for sleep and 5 from disown nohup sleep 5 &. What did you mean by that second command from the last sentence?
      – Ruslan
      Nov 26 at 20:54










    • @Ruslan Yes I'm missing a & in there (and the order of nohup and disown was also wrong). Thanks. Will update now.
      – Kusalananda
      Nov 26 at 20:55












    • For example, unix.stackexchange.com/questions/484315/…
      – Tim
      Nov 26 at 22:30










    • @Tim Sorry for the excessive editing of the answer. It took a while to get my head around it. I'm done now.
      – Kusalananda
      Nov 26 at 23:04










    • Thanks. disown makes a shell not sent SIGHUP to a child by removing the child from the shell's job list. How does disown -h achieve the same?
      – Tim
      Nov 26 at 23:14


















    I get bash: disown: nohup: no such job and same for sleep and 5 from disown nohup sleep 5 &. What did you mean by that second command from the last sentence?
    – Ruslan
    Nov 26 at 20:54




    I get bash: disown: nohup: no such job and same for sleep and 5 from disown nohup sleep 5 &. What did you mean by that second command from the last sentence?
    – Ruslan
    Nov 26 at 20:54












    @Ruslan Yes I'm missing a & in there (and the order of nohup and disown was also wrong). Thanks. Will update now.
    – Kusalananda
    Nov 26 at 20:55






    @Ruslan Yes I'm missing a & in there (and the order of nohup and disown was also wrong). Thanks. Will update now.
    – Kusalananda
    Nov 26 at 20:55














    For example, unix.stackexchange.com/questions/484315/…
    – Tim
    Nov 26 at 22:30




    For example, unix.stackexchange.com/questions/484315/…
    – Tim
    Nov 26 at 22:30












    @Tim Sorry for the excessive editing of the answer. It took a while to get my head around it. I'm done now.
    – Kusalananda
    Nov 26 at 23:04




    @Tim Sorry for the excessive editing of the answer. It took a while to get my head around it. I'm done now.
    – Kusalananda
    Nov 26 at 23:04












    Thanks. disown makes a shell not sent SIGHUP to a child by removing the child from the shell's job list. How does disown -h achieve the same?
    – Tim
    Nov 26 at 23:14






    Thanks. disown makes a shell not sent SIGHUP to a child by removing the child from the shell's job list. How does disown -h achieve the same?
    – Tim
    Nov 26 at 23:14














    up vote
    4
    down vote













    They are Different:




    • disown removes the job from the active jobs table. Then continues on with current job. With -h the proccess is NOT sent SIGHUP. It is instead left to die with the shell that contains it, when it recieves a SIGHUP.



    • nohup ignores the HUP. Then anything that would have been passed to the terminal by the proccess closing instead goes to a file nohup.out.




      nohup is defined by POSIX while disown is not.









    share|improve this answer

























      up vote
      4
      down vote













      They are Different:




      • disown removes the job from the active jobs table. Then continues on with current job. With -h the proccess is NOT sent SIGHUP. It is instead left to die with the shell that contains it, when it recieves a SIGHUP.



      • nohup ignores the HUP. Then anything that would have been passed to the terminal by the proccess closing instead goes to a file nohup.out.




        nohup is defined by POSIX while disown is not.









      share|improve this answer























        up vote
        4
        down vote










        up vote
        4
        down vote









        They are Different:




        • disown removes the job from the active jobs table. Then continues on with current job. With -h the proccess is NOT sent SIGHUP. It is instead left to die with the shell that contains it, when it recieves a SIGHUP.



        • nohup ignores the HUP. Then anything that would have been passed to the terminal by the proccess closing instead goes to a file nohup.out.




          nohup is defined by POSIX while disown is not.









        share|improve this answer












        They are Different:




        • disown removes the job from the active jobs table. Then continues on with current job. With -h the proccess is NOT sent SIGHUP. It is instead left to die with the shell that contains it, when it recieves a SIGHUP.



        • nohup ignores the HUP. Then anything that would have been passed to the terminal by the proccess closing instead goes to a file nohup.out.




          nohup is defined by POSIX while disown is not.










        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 26 at 20:17









        Michael Prokopec

        71316




        71316






























            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%2f484276%2fdo-disown-h-and-nohup-work-effectively-the-same%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

            flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

            Mangá

            Eduardo VII do Reino Unido