What is the difference between “when the operating system shuts down” and “when the kernel shuts...












2














Reading one of Stephen's excellent replies, I was wondering what differences are between




When the operating system shuts down. ...




and




When the kernel shuts down, ... (... I’m considering that the variant which uses an external command to shut down isn’t the kernel)




?



Is "the variant which uses an external command to shut down" "when the OS shuts down" or "when the kernel shuts down"?



What does "I’m considering that the variant which uses an external command to shut down isn’t the kernel" mean in other words?



Does system call reboot() reboot the OS or kernel?



Does command reboot reboot the OS but not the kernel?



Thanks.










share|improve this question
























  • Deleting the reference and link to the reboot() documentation, the most fundamental part of the sentence, from the last quote is utterly inexplicable to me.
    – Michael Homer
    Dec 18 '18 at 5:39










  • That's because I don't quite understant what the original means. If you do, thank you in advance to tell me what that means.
    – Tim
    Dec 18 '18 at 5:43








  • 2




    I think you should just quote accurately.
    – Michael Homer
    Dec 18 '18 at 6:03










  • I would think that the OS shuts down, then tells the kernel to shutdown, and when the kernel has shutdown, it will tell the hardware to shutdown (power off). If you skip a step, then things are not shutdown properly.
    – ctrl-alt-delor
    Dec 18 '18 at 13:19
















2














Reading one of Stephen's excellent replies, I was wondering what differences are between




When the operating system shuts down. ...




and




When the kernel shuts down, ... (... I’m considering that the variant which uses an external command to shut down isn’t the kernel)




?



Is "the variant which uses an external command to shut down" "when the OS shuts down" or "when the kernel shuts down"?



What does "I’m considering that the variant which uses an external command to shut down isn’t the kernel" mean in other words?



Does system call reboot() reboot the OS or kernel?



Does command reboot reboot the OS but not the kernel?



Thanks.










share|improve this question
























  • Deleting the reference and link to the reboot() documentation, the most fundamental part of the sentence, from the last quote is utterly inexplicable to me.
    – Michael Homer
    Dec 18 '18 at 5:39










  • That's because I don't quite understant what the original means. If you do, thank you in advance to tell me what that means.
    – Tim
    Dec 18 '18 at 5:43








  • 2




    I think you should just quote accurately.
    – Michael Homer
    Dec 18 '18 at 6:03










  • I would think that the OS shuts down, then tells the kernel to shutdown, and when the kernel has shutdown, it will tell the hardware to shutdown (power off). If you skip a step, then things are not shutdown properly.
    – ctrl-alt-delor
    Dec 18 '18 at 13:19














2












2








2


1





Reading one of Stephen's excellent replies, I was wondering what differences are between




When the operating system shuts down. ...




and




When the kernel shuts down, ... (... I’m considering that the variant which uses an external command to shut down isn’t the kernel)




?



Is "the variant which uses an external command to shut down" "when the OS shuts down" or "when the kernel shuts down"?



What does "I’m considering that the variant which uses an external command to shut down isn’t the kernel" mean in other words?



Does system call reboot() reboot the OS or kernel?



Does command reboot reboot the OS but not the kernel?



Thanks.










share|improve this question















Reading one of Stephen's excellent replies, I was wondering what differences are between




When the operating system shuts down. ...




and




When the kernel shuts down, ... (... I’m considering that the variant which uses an external command to shut down isn’t the kernel)




?



Is "the variant which uses an external command to shut down" "when the OS shuts down" or "when the kernel shuts down"?



What does "I’m considering that the variant which uses an external command to shut down isn’t the kernel" mean in other words?



Does system call reboot() reboot the OS or kernel?



Does command reboot reboot the OS but not the kernel?



Thanks.







linux kernel shutdown






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 18 '18 at 5:58

























asked Dec 18 '18 at 5:30









Tim

26k74246455




26k74246455












  • Deleting the reference and link to the reboot() documentation, the most fundamental part of the sentence, from the last quote is utterly inexplicable to me.
    – Michael Homer
    Dec 18 '18 at 5:39










  • That's because I don't quite understant what the original means. If you do, thank you in advance to tell me what that means.
    – Tim
    Dec 18 '18 at 5:43








  • 2




    I think you should just quote accurately.
    – Michael Homer
    Dec 18 '18 at 6:03










  • I would think that the OS shuts down, then tells the kernel to shutdown, and when the kernel has shutdown, it will tell the hardware to shutdown (power off). If you skip a step, then things are not shutdown properly.
    – ctrl-alt-delor
    Dec 18 '18 at 13:19


















  • Deleting the reference and link to the reboot() documentation, the most fundamental part of the sentence, from the last quote is utterly inexplicable to me.
    – Michael Homer
    Dec 18 '18 at 5:39










  • That's because I don't quite understant what the original means. If you do, thank you in advance to tell me what that means.
    – Tim
    Dec 18 '18 at 5:43








  • 2




    I think you should just quote accurately.
    – Michael Homer
    Dec 18 '18 at 6:03










  • I would think that the OS shuts down, then tells the kernel to shutdown, and when the kernel has shutdown, it will tell the hardware to shutdown (power off). If you skip a step, then things are not shutdown properly.
    – ctrl-alt-delor
    Dec 18 '18 at 13:19
















Deleting the reference and link to the reboot() documentation, the most fundamental part of the sentence, from the last quote is utterly inexplicable to me.
– Michael Homer
Dec 18 '18 at 5:39




Deleting the reference and link to the reboot() documentation, the most fundamental part of the sentence, from the last quote is utterly inexplicable to me.
– Michael Homer
Dec 18 '18 at 5:39












That's because I don't quite understant what the original means. If you do, thank you in advance to tell me what that means.
– Tim
Dec 18 '18 at 5:43






That's because I don't quite understant what the original means. If you do, thank you in advance to tell me what that means.
– Tim
Dec 18 '18 at 5:43






2




2




I think you should just quote accurately.
– Michael Homer
Dec 18 '18 at 6:03




I think you should just quote accurately.
– Michael Homer
Dec 18 '18 at 6:03












I would think that the OS shuts down, then tells the kernel to shutdown, and when the kernel has shutdown, it will tell the hardware to shutdown (power off). If you skip a step, then things are not shutdown properly.
– ctrl-alt-delor
Dec 18 '18 at 13:19




I would think that the OS shuts down, then tells the kernel to shutdown, and when the kernel has shutdown, it will tell the hardware to shutdown (power off). If you skip a step, then things are not shutdown properly.
– ctrl-alt-delor
Dec 18 '18 at 13:19










2 Answers
2






active

oldest

votes


















6














He seems to be noting a difference between the kernel itself, and the rest of the operating system, the user-space constructs built on top of the kernel.



When you shut down the system with /sbin/reboot or equivalent (which in turn calls systemd or some init scripts or something), it does more than just ask the kernel to shut down. The user-space tools are the ones that do almost all the cleanup, like unmounting filesystems, sending SIGTERM to other processes ask them to shut down, etc.



If, instead, you go and call the reboot() system call as root directly, then none of that cleanup happens, the kernel just does what it's told to do and shuts down right away (possibly restarting or powering down the machine). The man page notes that reboot() doesn't even do the equivalent of sync(), so it doesn't even do the kinds of cleanup that could be done within the kernel (where the filesystem drivers and I/O buffers reside.)



As an example from the man page:



LINUX_REBOOT_CMD_RESTART
(RB_AUTOBOOT, 0x1234567). The message "Restarting system." is
printed, and a default restart is performed immediately. If
not preceded by a sync(2), data will be lost.


So,




Does system call reboot() reboot the OS or kernel?




It asks the kernel to shut down or reboot, the OS goes down with it.




Does command reboot reboot the OS but not the kernel?




It asks user-space processes to shut down, does other cleanup, and only then asks the kernel to shut down or reboot.



The reboot() system call has a mode (LINUX_REBOOT_CMD_RESTART2) that is described as "using a command string". However, it doesn't mean a user-mode command, but one internal to the kernel, and one that isn't even used on x86.



Note that while we're considering the distinction between the kernel and the OS-on-top-of-the-kernel, you could in principle reboot just the OS but keep the kernel running. You'd need to clean up everything set up by the userspace and kill other userspace processes, then restart init to bring everything back up again instead of asking the kernel to reboot. That might not be very useful though, and it would be hard to reliably reset all state left in the kernel (you'd need to manually reset all network interfaces, clean up iptables rules, reset RAID and loop devices, etc. etc. There's a good chance of missing something that might then bite back afterwards.)






share|improve this answer



















  • 2




    That’s exactly the distinction I was trying to make, thanks for taking the time to write it up!
    – Stephen Kitt
    Dec 18 '18 at 10:31










  • Thanks. "An added confusion here is caused by the fact that the reboot() system call appears to be capable of running a process to do the restart (however that works)" What confusion is it? Do you mean that the command string given in arg is run before the kernel is shutdown, so may do some cleanup?
    – Tim
    Dec 19 '18 at 2:21










  • @Tim, yeah, basically that. If the command given to reboot() can do whatever it likes, just as any other userspace program, then it's not really true in that case to say that reboot() doesn't do any cleanup. (I've no idea how the reboot()-calling-userspace variant works, if there are any limitations.) But the other reboot() variants don't do any cleanup, that's for sure.
    – ilkkachu
    Dec 19 '18 at 8:27










  • Thanks. unix.stackexchange.com/questions/489995/…
    – Tim
    Dec 19 '18 at 20:24





















8














The post you have quoted from actually says this:




When the kernel shuts down, or reboots, it doesn’t care about processes and doesn’t kill them (see reboot() for details; I’m considering that the variant which uses an external command to shut down isn’t the kernel).




Your selective editing has spliced together unrelated sentences to create a false impression.



The part you have kept (from after the semicolon) relates to the part immediately before the semicolon (which you have deleted). That is, the variant of reboot() which uses an external command to shut down (LINUX_REBOOT_CMD_RESTART2, in the documentation, which was linked) is being excluded from consideration for Stephen's purposes.



The first quote is not relevant.






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',
    autoActivateHeartbeat: false,
    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%2f489609%2fwhat-is-the-difference-between-when-the-operating-system-shuts-down-and-when%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









    6














    He seems to be noting a difference between the kernel itself, and the rest of the operating system, the user-space constructs built on top of the kernel.



    When you shut down the system with /sbin/reboot or equivalent (which in turn calls systemd or some init scripts or something), it does more than just ask the kernel to shut down. The user-space tools are the ones that do almost all the cleanup, like unmounting filesystems, sending SIGTERM to other processes ask them to shut down, etc.



    If, instead, you go and call the reboot() system call as root directly, then none of that cleanup happens, the kernel just does what it's told to do and shuts down right away (possibly restarting or powering down the machine). The man page notes that reboot() doesn't even do the equivalent of sync(), so it doesn't even do the kinds of cleanup that could be done within the kernel (where the filesystem drivers and I/O buffers reside.)



    As an example from the man page:



    LINUX_REBOOT_CMD_RESTART
    (RB_AUTOBOOT, 0x1234567). The message "Restarting system." is
    printed, and a default restart is performed immediately. If
    not preceded by a sync(2), data will be lost.


    So,




    Does system call reboot() reboot the OS or kernel?




    It asks the kernel to shut down or reboot, the OS goes down with it.




    Does command reboot reboot the OS but not the kernel?




    It asks user-space processes to shut down, does other cleanup, and only then asks the kernel to shut down or reboot.



    The reboot() system call has a mode (LINUX_REBOOT_CMD_RESTART2) that is described as "using a command string". However, it doesn't mean a user-mode command, but one internal to the kernel, and one that isn't even used on x86.



    Note that while we're considering the distinction between the kernel and the OS-on-top-of-the-kernel, you could in principle reboot just the OS but keep the kernel running. You'd need to clean up everything set up by the userspace and kill other userspace processes, then restart init to bring everything back up again instead of asking the kernel to reboot. That might not be very useful though, and it would be hard to reliably reset all state left in the kernel (you'd need to manually reset all network interfaces, clean up iptables rules, reset RAID and loop devices, etc. etc. There's a good chance of missing something that might then bite back afterwards.)






    share|improve this answer



















    • 2




      That’s exactly the distinction I was trying to make, thanks for taking the time to write it up!
      – Stephen Kitt
      Dec 18 '18 at 10:31










    • Thanks. "An added confusion here is caused by the fact that the reboot() system call appears to be capable of running a process to do the restart (however that works)" What confusion is it? Do you mean that the command string given in arg is run before the kernel is shutdown, so may do some cleanup?
      – Tim
      Dec 19 '18 at 2:21










    • @Tim, yeah, basically that. If the command given to reboot() can do whatever it likes, just as any other userspace program, then it's not really true in that case to say that reboot() doesn't do any cleanup. (I've no idea how the reboot()-calling-userspace variant works, if there are any limitations.) But the other reboot() variants don't do any cleanup, that's for sure.
      – ilkkachu
      Dec 19 '18 at 8:27










    • Thanks. unix.stackexchange.com/questions/489995/…
      – Tim
      Dec 19 '18 at 20:24


















    6














    He seems to be noting a difference between the kernel itself, and the rest of the operating system, the user-space constructs built on top of the kernel.



    When you shut down the system with /sbin/reboot or equivalent (which in turn calls systemd or some init scripts or something), it does more than just ask the kernel to shut down. The user-space tools are the ones that do almost all the cleanup, like unmounting filesystems, sending SIGTERM to other processes ask them to shut down, etc.



    If, instead, you go and call the reboot() system call as root directly, then none of that cleanup happens, the kernel just does what it's told to do and shuts down right away (possibly restarting or powering down the machine). The man page notes that reboot() doesn't even do the equivalent of sync(), so it doesn't even do the kinds of cleanup that could be done within the kernel (where the filesystem drivers and I/O buffers reside.)



    As an example from the man page:



    LINUX_REBOOT_CMD_RESTART
    (RB_AUTOBOOT, 0x1234567). The message "Restarting system." is
    printed, and a default restart is performed immediately. If
    not preceded by a sync(2), data will be lost.


    So,




    Does system call reboot() reboot the OS or kernel?




    It asks the kernel to shut down or reboot, the OS goes down with it.




    Does command reboot reboot the OS but not the kernel?




    It asks user-space processes to shut down, does other cleanup, and only then asks the kernel to shut down or reboot.



    The reboot() system call has a mode (LINUX_REBOOT_CMD_RESTART2) that is described as "using a command string". However, it doesn't mean a user-mode command, but one internal to the kernel, and one that isn't even used on x86.



    Note that while we're considering the distinction between the kernel and the OS-on-top-of-the-kernel, you could in principle reboot just the OS but keep the kernel running. You'd need to clean up everything set up by the userspace and kill other userspace processes, then restart init to bring everything back up again instead of asking the kernel to reboot. That might not be very useful though, and it would be hard to reliably reset all state left in the kernel (you'd need to manually reset all network interfaces, clean up iptables rules, reset RAID and loop devices, etc. etc. There's a good chance of missing something that might then bite back afterwards.)






    share|improve this answer



















    • 2




      That’s exactly the distinction I was trying to make, thanks for taking the time to write it up!
      – Stephen Kitt
      Dec 18 '18 at 10:31










    • Thanks. "An added confusion here is caused by the fact that the reboot() system call appears to be capable of running a process to do the restart (however that works)" What confusion is it? Do you mean that the command string given in arg is run before the kernel is shutdown, so may do some cleanup?
      – Tim
      Dec 19 '18 at 2:21










    • @Tim, yeah, basically that. If the command given to reboot() can do whatever it likes, just as any other userspace program, then it's not really true in that case to say that reboot() doesn't do any cleanup. (I've no idea how the reboot()-calling-userspace variant works, if there are any limitations.) But the other reboot() variants don't do any cleanup, that's for sure.
      – ilkkachu
      Dec 19 '18 at 8:27










    • Thanks. unix.stackexchange.com/questions/489995/…
      – Tim
      Dec 19 '18 at 20:24
















    6












    6








    6






    He seems to be noting a difference between the kernel itself, and the rest of the operating system, the user-space constructs built on top of the kernel.



    When you shut down the system with /sbin/reboot or equivalent (which in turn calls systemd or some init scripts or something), it does more than just ask the kernel to shut down. The user-space tools are the ones that do almost all the cleanup, like unmounting filesystems, sending SIGTERM to other processes ask them to shut down, etc.



    If, instead, you go and call the reboot() system call as root directly, then none of that cleanup happens, the kernel just does what it's told to do and shuts down right away (possibly restarting or powering down the machine). The man page notes that reboot() doesn't even do the equivalent of sync(), so it doesn't even do the kinds of cleanup that could be done within the kernel (where the filesystem drivers and I/O buffers reside.)



    As an example from the man page:



    LINUX_REBOOT_CMD_RESTART
    (RB_AUTOBOOT, 0x1234567). The message "Restarting system." is
    printed, and a default restart is performed immediately. If
    not preceded by a sync(2), data will be lost.


    So,




    Does system call reboot() reboot the OS or kernel?




    It asks the kernel to shut down or reboot, the OS goes down with it.




    Does command reboot reboot the OS but not the kernel?




    It asks user-space processes to shut down, does other cleanup, and only then asks the kernel to shut down or reboot.



    The reboot() system call has a mode (LINUX_REBOOT_CMD_RESTART2) that is described as "using a command string". However, it doesn't mean a user-mode command, but one internal to the kernel, and one that isn't even used on x86.



    Note that while we're considering the distinction between the kernel and the OS-on-top-of-the-kernel, you could in principle reboot just the OS but keep the kernel running. You'd need to clean up everything set up by the userspace and kill other userspace processes, then restart init to bring everything back up again instead of asking the kernel to reboot. That might not be very useful though, and it would be hard to reliably reset all state left in the kernel (you'd need to manually reset all network interfaces, clean up iptables rules, reset RAID and loop devices, etc. etc. There's a good chance of missing something that might then bite back afterwards.)






    share|improve this answer














    He seems to be noting a difference between the kernel itself, and the rest of the operating system, the user-space constructs built on top of the kernel.



    When you shut down the system with /sbin/reboot or equivalent (which in turn calls systemd or some init scripts or something), it does more than just ask the kernel to shut down. The user-space tools are the ones that do almost all the cleanup, like unmounting filesystems, sending SIGTERM to other processes ask them to shut down, etc.



    If, instead, you go and call the reboot() system call as root directly, then none of that cleanup happens, the kernel just does what it's told to do and shuts down right away (possibly restarting or powering down the machine). The man page notes that reboot() doesn't even do the equivalent of sync(), so it doesn't even do the kinds of cleanup that could be done within the kernel (where the filesystem drivers and I/O buffers reside.)



    As an example from the man page:



    LINUX_REBOOT_CMD_RESTART
    (RB_AUTOBOOT, 0x1234567). The message "Restarting system." is
    printed, and a default restart is performed immediately. If
    not preceded by a sync(2), data will be lost.


    So,




    Does system call reboot() reboot the OS or kernel?




    It asks the kernel to shut down or reboot, the OS goes down with it.




    Does command reboot reboot the OS but not the kernel?




    It asks user-space processes to shut down, does other cleanup, and only then asks the kernel to shut down or reboot.



    The reboot() system call has a mode (LINUX_REBOOT_CMD_RESTART2) that is described as "using a command string". However, it doesn't mean a user-mode command, but one internal to the kernel, and one that isn't even used on x86.



    Note that while we're considering the distinction between the kernel and the OS-on-top-of-the-kernel, you could in principle reboot just the OS but keep the kernel running. You'd need to clean up everything set up by the userspace and kill other userspace processes, then restart init to bring everything back up again instead of asking the kernel to reboot. That might not be very useful though, and it would be hard to reliably reset all state left in the kernel (you'd need to manually reset all network interfaces, clean up iptables rules, reset RAID and loop devices, etc. etc. There's a good chance of missing something that might then bite back afterwards.)







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Dec 20 '18 at 14:43

























    answered Dec 18 '18 at 10:03









    ilkkachu

    55.9k784155




    55.9k784155








    • 2




      That’s exactly the distinction I was trying to make, thanks for taking the time to write it up!
      – Stephen Kitt
      Dec 18 '18 at 10:31










    • Thanks. "An added confusion here is caused by the fact that the reboot() system call appears to be capable of running a process to do the restart (however that works)" What confusion is it? Do you mean that the command string given in arg is run before the kernel is shutdown, so may do some cleanup?
      – Tim
      Dec 19 '18 at 2:21










    • @Tim, yeah, basically that. If the command given to reboot() can do whatever it likes, just as any other userspace program, then it's not really true in that case to say that reboot() doesn't do any cleanup. (I've no idea how the reboot()-calling-userspace variant works, if there are any limitations.) But the other reboot() variants don't do any cleanup, that's for sure.
      – ilkkachu
      Dec 19 '18 at 8:27










    • Thanks. unix.stackexchange.com/questions/489995/…
      – Tim
      Dec 19 '18 at 20:24
















    • 2




      That’s exactly the distinction I was trying to make, thanks for taking the time to write it up!
      – Stephen Kitt
      Dec 18 '18 at 10:31










    • Thanks. "An added confusion here is caused by the fact that the reboot() system call appears to be capable of running a process to do the restart (however that works)" What confusion is it? Do you mean that the command string given in arg is run before the kernel is shutdown, so may do some cleanup?
      – Tim
      Dec 19 '18 at 2:21










    • @Tim, yeah, basically that. If the command given to reboot() can do whatever it likes, just as any other userspace program, then it's not really true in that case to say that reboot() doesn't do any cleanup. (I've no idea how the reboot()-calling-userspace variant works, if there are any limitations.) But the other reboot() variants don't do any cleanup, that's for sure.
      – ilkkachu
      Dec 19 '18 at 8:27










    • Thanks. unix.stackexchange.com/questions/489995/…
      – Tim
      Dec 19 '18 at 20:24










    2




    2




    That’s exactly the distinction I was trying to make, thanks for taking the time to write it up!
    – Stephen Kitt
    Dec 18 '18 at 10:31




    That’s exactly the distinction I was trying to make, thanks for taking the time to write it up!
    – Stephen Kitt
    Dec 18 '18 at 10:31












    Thanks. "An added confusion here is caused by the fact that the reboot() system call appears to be capable of running a process to do the restart (however that works)" What confusion is it? Do you mean that the command string given in arg is run before the kernel is shutdown, so may do some cleanup?
    – Tim
    Dec 19 '18 at 2:21




    Thanks. "An added confusion here is caused by the fact that the reboot() system call appears to be capable of running a process to do the restart (however that works)" What confusion is it? Do you mean that the command string given in arg is run before the kernel is shutdown, so may do some cleanup?
    – Tim
    Dec 19 '18 at 2:21












    @Tim, yeah, basically that. If the command given to reboot() can do whatever it likes, just as any other userspace program, then it's not really true in that case to say that reboot() doesn't do any cleanup. (I've no idea how the reboot()-calling-userspace variant works, if there are any limitations.) But the other reboot() variants don't do any cleanup, that's for sure.
    – ilkkachu
    Dec 19 '18 at 8:27




    @Tim, yeah, basically that. If the command given to reboot() can do whatever it likes, just as any other userspace program, then it's not really true in that case to say that reboot() doesn't do any cleanup. (I've no idea how the reboot()-calling-userspace variant works, if there are any limitations.) But the other reboot() variants don't do any cleanup, that's for sure.
    – ilkkachu
    Dec 19 '18 at 8:27












    Thanks. unix.stackexchange.com/questions/489995/…
    – Tim
    Dec 19 '18 at 20:24






    Thanks. unix.stackexchange.com/questions/489995/…
    – Tim
    Dec 19 '18 at 20:24















    8














    The post you have quoted from actually says this:




    When the kernel shuts down, or reboots, it doesn’t care about processes and doesn’t kill them (see reboot() for details; I’m considering that the variant which uses an external command to shut down isn’t the kernel).




    Your selective editing has spliced together unrelated sentences to create a false impression.



    The part you have kept (from after the semicolon) relates to the part immediately before the semicolon (which you have deleted). That is, the variant of reboot() which uses an external command to shut down (LINUX_REBOOT_CMD_RESTART2, in the documentation, which was linked) is being excluded from consideration for Stephen's purposes.



    The first quote is not relevant.






    share|improve this answer


























      8














      The post you have quoted from actually says this:




      When the kernel shuts down, or reboots, it doesn’t care about processes and doesn’t kill them (see reboot() for details; I’m considering that the variant which uses an external command to shut down isn’t the kernel).




      Your selective editing has spliced together unrelated sentences to create a false impression.



      The part you have kept (from after the semicolon) relates to the part immediately before the semicolon (which you have deleted). That is, the variant of reboot() which uses an external command to shut down (LINUX_REBOOT_CMD_RESTART2, in the documentation, which was linked) is being excluded from consideration for Stephen's purposes.



      The first quote is not relevant.






      share|improve this answer
























        8












        8








        8






        The post you have quoted from actually says this:




        When the kernel shuts down, or reboots, it doesn’t care about processes and doesn’t kill them (see reboot() for details; I’m considering that the variant which uses an external command to shut down isn’t the kernel).




        Your selective editing has spliced together unrelated sentences to create a false impression.



        The part you have kept (from after the semicolon) relates to the part immediately before the semicolon (which you have deleted). That is, the variant of reboot() which uses an external command to shut down (LINUX_REBOOT_CMD_RESTART2, in the documentation, which was linked) is being excluded from consideration for Stephen's purposes.



        The first quote is not relevant.






        share|improve this answer












        The post you have quoted from actually says this:




        When the kernel shuts down, or reboots, it doesn’t care about processes and doesn’t kill them (see reboot() for details; I’m considering that the variant which uses an external command to shut down isn’t the kernel).




        Your selective editing has spliced together unrelated sentences to create a false impression.



        The part you have kept (from after the semicolon) relates to the part immediately before the semicolon (which you have deleted). That is, the variant of reboot() which uses an external command to shut down (LINUX_REBOOT_CMD_RESTART2, in the documentation, which was linked) is being excluded from consideration for Stephen's purposes.



        The first quote is not relevant.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 18 '18 at 6:02









        Michael Homer

        45.7k8121160




        45.7k8121160






























            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%2f489609%2fwhat-is-the-difference-between-when-the-operating-system-shuts-down-and-when%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

            Aardman Animations

            Are they similar matrix

            “minimization” problem in Euclidean space related to orthonormal basis