When is a reboot required?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
25
down vote

favorite
20












Apart from upgrading the kernel, are there any changes to a Linux system that require a reboot? I know there are situations where a reboot makes things easier, but are there any that cannot be accomplished except with a reboot?



To clarify: I'm thinking of a typical desktop or server system that isn't suffering from a hardware malfunction.










share|improve this question



















  • 3




    every thing can be done without rebooting. even changing the kernel can be done using ksplice so you can hot swap your kernel. The only thing you need to take into account is the fact making everything without rebooting can be very complex
    – Kiwy
    Apr 4 '14 at 8:39







  • 4




    Your question is very broad, because "Linux system" can mean many very different things.
    – Zrin
    Apr 4 '14 at 9:02











  • Also "any changes" can mean quite a lot of different situations. Is recovery from failed hard drive that is part of an MD mirror such a change? If yes, then - unfortunately - it will sometimes require a reboot, because for example some HDD failures (on some HDD controllers) are able to make the system unresponsive. But you are probably not asking about such "changes" ...
    – Zrin
    Apr 4 '14 at 9:11






  • 3




    @Kiwy Technically ksplice doesn't change the kernel. Ksplice allows a running kernel to be patched, while it is running. You might be thinking of kexec, which allows a new kernel image to be loaded "over" a running kernel in memory.
    – Thomas Nyman
    Apr 4 '14 at 10:09










  • This reminds me, windows XP (I never went beyond) never shuts up about restarting even if it just updated IE8 (or whatever number) which hasn't been opened for 4 years, since the installation of Windows and hence the need to download a browser.
    – Shahbaz
    Apr 5 '14 at 18:16














up vote
25
down vote

favorite
20












Apart from upgrading the kernel, are there any changes to a Linux system that require a reboot? I know there are situations where a reboot makes things easier, but are there any that cannot be accomplished except with a reboot?



To clarify: I'm thinking of a typical desktop or server system that isn't suffering from a hardware malfunction.










share|improve this question



















  • 3




    every thing can be done without rebooting. even changing the kernel can be done using ksplice so you can hot swap your kernel. The only thing you need to take into account is the fact making everything without rebooting can be very complex
    – Kiwy
    Apr 4 '14 at 8:39







  • 4




    Your question is very broad, because "Linux system" can mean many very different things.
    – Zrin
    Apr 4 '14 at 9:02











  • Also "any changes" can mean quite a lot of different situations. Is recovery from failed hard drive that is part of an MD mirror such a change? If yes, then - unfortunately - it will sometimes require a reboot, because for example some HDD failures (on some HDD controllers) are able to make the system unresponsive. But you are probably not asking about such "changes" ...
    – Zrin
    Apr 4 '14 at 9:11






  • 3




    @Kiwy Technically ksplice doesn't change the kernel. Ksplice allows a running kernel to be patched, while it is running. You might be thinking of kexec, which allows a new kernel image to be loaded "over" a running kernel in memory.
    – Thomas Nyman
    Apr 4 '14 at 10:09










  • This reminds me, windows XP (I never went beyond) never shuts up about restarting even if it just updated IE8 (or whatever number) which hasn't been opened for 4 years, since the installation of Windows and hence the need to download a browser.
    – Shahbaz
    Apr 5 '14 at 18:16












up vote
25
down vote

favorite
20









up vote
25
down vote

favorite
20






20





Apart from upgrading the kernel, are there any changes to a Linux system that require a reboot? I know there are situations where a reboot makes things easier, but are there any that cannot be accomplished except with a reboot?



To clarify: I'm thinking of a typical desktop or server system that isn't suffering from a hardware malfunction.










share|improve this question















Apart from upgrading the kernel, are there any changes to a Linux system that require a reboot? I know there are situations where a reboot makes things easier, but are there any that cannot be accomplished except with a reboot?



To clarify: I'm thinking of a typical desktop or server system that isn't suffering from a hardware malfunction.







linux reboot






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 4 '14 at 9:13

























asked Apr 4 '14 at 8:35









Mark

1,89611326




1,89611326







  • 3




    every thing can be done without rebooting. even changing the kernel can be done using ksplice so you can hot swap your kernel. The only thing you need to take into account is the fact making everything without rebooting can be very complex
    – Kiwy
    Apr 4 '14 at 8:39







  • 4




    Your question is very broad, because "Linux system" can mean many very different things.
    – Zrin
    Apr 4 '14 at 9:02











  • Also "any changes" can mean quite a lot of different situations. Is recovery from failed hard drive that is part of an MD mirror such a change? If yes, then - unfortunately - it will sometimes require a reboot, because for example some HDD failures (on some HDD controllers) are able to make the system unresponsive. But you are probably not asking about such "changes" ...
    – Zrin
    Apr 4 '14 at 9:11






  • 3




    @Kiwy Technically ksplice doesn't change the kernel. Ksplice allows a running kernel to be patched, while it is running. You might be thinking of kexec, which allows a new kernel image to be loaded "over" a running kernel in memory.
    – Thomas Nyman
    Apr 4 '14 at 10:09










  • This reminds me, windows XP (I never went beyond) never shuts up about restarting even if it just updated IE8 (or whatever number) which hasn't been opened for 4 years, since the installation of Windows and hence the need to download a browser.
    – Shahbaz
    Apr 5 '14 at 18:16












  • 3




    every thing can be done without rebooting. even changing the kernel can be done using ksplice so you can hot swap your kernel. The only thing you need to take into account is the fact making everything without rebooting can be very complex
    – Kiwy
    Apr 4 '14 at 8:39







  • 4




    Your question is very broad, because "Linux system" can mean many very different things.
    – Zrin
    Apr 4 '14 at 9:02











  • Also "any changes" can mean quite a lot of different situations. Is recovery from failed hard drive that is part of an MD mirror such a change? If yes, then - unfortunately - it will sometimes require a reboot, because for example some HDD failures (on some HDD controllers) are able to make the system unresponsive. But you are probably not asking about such "changes" ...
    – Zrin
    Apr 4 '14 at 9:11






  • 3




    @Kiwy Technically ksplice doesn't change the kernel. Ksplice allows a running kernel to be patched, while it is running. You might be thinking of kexec, which allows a new kernel image to be loaded "over" a running kernel in memory.
    – Thomas Nyman
    Apr 4 '14 at 10:09










  • This reminds me, windows XP (I never went beyond) never shuts up about restarting even if it just updated IE8 (or whatever number) which hasn't been opened for 4 years, since the installation of Windows and hence the need to download a browser.
    – Shahbaz
    Apr 5 '14 at 18:16







3




3




every thing can be done without rebooting. even changing the kernel can be done using ksplice so you can hot swap your kernel. The only thing you need to take into account is the fact making everything without rebooting can be very complex
– Kiwy
Apr 4 '14 at 8:39





every thing can be done without rebooting. even changing the kernel can be done using ksplice so you can hot swap your kernel. The only thing you need to take into account is the fact making everything without rebooting can be very complex
– Kiwy
Apr 4 '14 at 8:39





4




4




Your question is very broad, because "Linux system" can mean many very different things.
– Zrin
Apr 4 '14 at 9:02





Your question is very broad, because "Linux system" can mean many very different things.
– Zrin
Apr 4 '14 at 9:02













Also "any changes" can mean quite a lot of different situations. Is recovery from failed hard drive that is part of an MD mirror such a change? If yes, then - unfortunately - it will sometimes require a reboot, because for example some HDD failures (on some HDD controllers) are able to make the system unresponsive. But you are probably not asking about such "changes" ...
– Zrin
Apr 4 '14 at 9:11




Also "any changes" can mean quite a lot of different situations. Is recovery from failed hard drive that is part of an MD mirror such a change? If yes, then - unfortunately - it will sometimes require a reboot, because for example some HDD failures (on some HDD controllers) are able to make the system unresponsive. But you are probably not asking about such "changes" ...
– Zrin
Apr 4 '14 at 9:11




3




3




@Kiwy Technically ksplice doesn't change the kernel. Ksplice allows a running kernel to be patched, while it is running. You might be thinking of kexec, which allows a new kernel image to be loaded "over" a running kernel in memory.
– Thomas Nyman
Apr 4 '14 at 10:09




@Kiwy Technically ksplice doesn't change the kernel. Ksplice allows a running kernel to be patched, while it is running. You might be thinking of kexec, which allows a new kernel image to be loaded "over" a running kernel in memory.
– Thomas Nyman
Apr 4 '14 at 10:09












This reminds me, windows XP (I never went beyond) never shuts up about restarting even if it just updated IE8 (or whatever number) which hasn't been opened for 4 years, since the installation of Windows and hence the need to download a browser.
– Shahbaz
Apr 5 '14 at 18:16




This reminds me, windows XP (I never went beyond) never shuts up about restarting even if it just updated IE8 (or whatever number) which hasn't been opened for 4 years, since the installation of Windows and hence the need to download a browser.
– Shahbaz
Apr 5 '14 at 18:16










3 Answers
3






active

oldest

votes

















up vote
43
down vote



accepted










A couple of things come to mind:




  • Recover from a kernel panic



    A kernel panic, by definition, cannot be recovered from without restarting the kernel.




  • Recover from hangs which leave you without terminal access



    If the system is unresponsive and you're stranded without a way to issue commands to recover, the only thing you might be able to do is to reboot. Usually, you'd want to avoid manual power cycling. For these kinds of situations, the Linux kernel has Magic SysRq support which can be used to reboot the machine in an emergency.



    As long as CONFIG_MAGIC_SYSRQ option has been enabled in the kernel configuration, and the kernel.sysrq sysctl option is enabled, you can issue commands directly to the kernel with magic SysRq key combinations:



    Note that Alt+SysRq below means press and hold down Alt, then press and hold SysRq (typically the PrintScrn key).




    1. Alt+SysRq+r: regain control of keyboard


    2. Alt+SysRq+e: send SIGTERM to all processes, except init, giving them a chance to terminate gracefully


    3. Alt+SysRq+i: send SIGKILL to all processes, except init, forcing them to terminate


    4. Alt+SysRq+s: attempt to sync all mounted filesystems


    5. Alt+SysRq+u: remount all filesystem read-only


    6. Alt+SysRq+b: reboot, or



      Alt+SysRq+o: shutdown



    A mnemonic for the magic SysRq key combinations to attempt a graceful reboot is:



    "Reboot Even If System Utterly Broke"



    For headless servers, there's even an iptables target enabling remote SysRq sequences over a network.




  • Recover from unbootable state



    If the system has already been brought to a state where a regular boot is not possible (e.g. as a result of a failed system upgrade, corrupt filesystem etc.), then the only way to access a recovery console on the system might be to reboot using appropriate boot-time options.




  • Change boot-time kernel parameters



    Some kernel parameters (e.g. audit to enable / disable kernel auditing) can only be set when the kernel is loaded at boot-time.







share|improve this answer


















  • 3




    "Reboot Even If System Utterly Broke" I'm favoriting this question just in case, but I don't think I'll ever forget that.
    – embedded.kyle
    Apr 4 '14 at 13:16






  • 1




    It is possibly worth noting you can get out of a panic using a kexec and avoid a complete reboot. This also applies equally to the getting out of unbootable state point. (they are not the same thing by any means, at least on an x86 system). However +1 for the rest of this answer.
    – Vality
    Apr 4 '14 at 13:55










  • @Vality Thanks for your comment. If kexec entails a reboot depends perhaps to a certain extent on ones point of view. The kdump documentation for instance describes kexec-on-panic as a reboot which preserves the system kernel's memory image. As for the point about unbootable state, I also considered things like bootloader misconfiguration (e.g. failure to load kernel in the first place), where kexec does not help. Given the nature of the question, I think some difference of opinion regarding semantics is unavoidable.
    – Thomas Nyman
    Apr 4 '14 at 16:37










  • @ThomasNyman Thank you for your detailed response, looking at the question you are correct I feel. I think talking about kexec will probably just needlessly complicate things for the target audience or this question. And you also make a good point regarding boot-loader errors.
    – Vality
    Apr 4 '14 at 16:42










  • I had never noticed that little SysRq written under print screen! This is awesome. I wish I had known this when I was learning kernel module programming!
    – Shahbaz
    Apr 5 '14 at 18:20

















up vote
2
down vote













There are two times I can think of where I would want to reboot:




  1. When I need to make sure that the system can boot up in the proper state.



    I once worked on a system that had some daemon configured while it was running. After it ran for a few years, a power failure caused it to reboot, but the daemon was not part of the startup process and nobody had a clue how it had been configured years earlier. The system was down for days while we figured out how to reconfigure it.



    Actually rebooting is the only way to know for sure that your system will restart properly after a power failure.




  2. When a system library has been updated.



    Let's say that a major security flaw has been discovered in a library that's shared with many apps/servers on the system. You can update the library without rebooting, but how many processes are still running with the insecure library loaded? You can painstakingly restart anything using the old library (if you can figure it out), but that is error prone and can take longer than just rebooting.



    Rebooting is the best way to be sure that all running processes are not still using the old, buggy library.







share|improve this answer




















  • There are better ways to find all binaries depending on a certain library if you use a good package manager. revdep-rebuilt from Gentoo comes to mind.
    – Spidey
    Apr 5 '14 at 0:34






  • 1




    @Spidey: Once you rebuild those binaries, how do you ensure that there are no old processes running with the buggy library?
    – Gabe
    Apr 5 '14 at 2:30






  • 1




    How do you know which daemons have the offending libraries loaded?
    – Gabe
    Apr 5 '14 at 2:48






  • 1




    @Gabe You could for instance check which processes have the libraries mapped to their memory space using lsof before you upgrade the libraries.
    – Thomas Nyman
    Apr 5 '14 at 11:32






  • 1




    @Gabe Sure, and while I agree that that's a perfectly good reason to reboot, the OP is explicitly not asking in which cases a reboot is more conventient, but when a reboot is absolutely necessary.
    – Thomas Nyman
    Apr 5 '14 at 19:44

















up vote
0
down vote













If you mean planned changes in the software configuration and assume perfectly working hardware (I haven't seen such yet) and bug-free software (you know ...), then only a bug in the kernel or a driver would force you to reboot. :)



Other than that ... I'm not sure if it would be possible to replace init without switching to single user mode and doing some magic which is essentially not much different than a reboot.






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: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    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%2f123088%2fwhen-is-a-reboot-required%23new-answer', 'question_page');

    );

    Post as a guest






























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    43
    down vote



    accepted










    A couple of things come to mind:




    • Recover from a kernel panic



      A kernel panic, by definition, cannot be recovered from without restarting the kernel.




    • Recover from hangs which leave you without terminal access



      If the system is unresponsive and you're stranded without a way to issue commands to recover, the only thing you might be able to do is to reboot. Usually, you'd want to avoid manual power cycling. For these kinds of situations, the Linux kernel has Magic SysRq support which can be used to reboot the machine in an emergency.



      As long as CONFIG_MAGIC_SYSRQ option has been enabled in the kernel configuration, and the kernel.sysrq sysctl option is enabled, you can issue commands directly to the kernel with magic SysRq key combinations:



      Note that Alt+SysRq below means press and hold down Alt, then press and hold SysRq (typically the PrintScrn key).




      1. Alt+SysRq+r: regain control of keyboard


      2. Alt+SysRq+e: send SIGTERM to all processes, except init, giving them a chance to terminate gracefully


      3. Alt+SysRq+i: send SIGKILL to all processes, except init, forcing them to terminate


      4. Alt+SysRq+s: attempt to sync all mounted filesystems


      5. Alt+SysRq+u: remount all filesystem read-only


      6. Alt+SysRq+b: reboot, or



        Alt+SysRq+o: shutdown



      A mnemonic for the magic SysRq key combinations to attempt a graceful reboot is:



      "Reboot Even If System Utterly Broke"



      For headless servers, there's even an iptables target enabling remote SysRq sequences over a network.




    • Recover from unbootable state



      If the system has already been brought to a state where a regular boot is not possible (e.g. as a result of a failed system upgrade, corrupt filesystem etc.), then the only way to access a recovery console on the system might be to reboot using appropriate boot-time options.




    • Change boot-time kernel parameters



      Some kernel parameters (e.g. audit to enable / disable kernel auditing) can only be set when the kernel is loaded at boot-time.







    share|improve this answer


















    • 3




      "Reboot Even If System Utterly Broke" I'm favoriting this question just in case, but I don't think I'll ever forget that.
      – embedded.kyle
      Apr 4 '14 at 13:16






    • 1




      It is possibly worth noting you can get out of a panic using a kexec and avoid a complete reboot. This also applies equally to the getting out of unbootable state point. (they are not the same thing by any means, at least on an x86 system). However +1 for the rest of this answer.
      – Vality
      Apr 4 '14 at 13:55










    • @Vality Thanks for your comment. If kexec entails a reboot depends perhaps to a certain extent on ones point of view. The kdump documentation for instance describes kexec-on-panic as a reboot which preserves the system kernel's memory image. As for the point about unbootable state, I also considered things like bootloader misconfiguration (e.g. failure to load kernel in the first place), where kexec does not help. Given the nature of the question, I think some difference of opinion regarding semantics is unavoidable.
      – Thomas Nyman
      Apr 4 '14 at 16:37










    • @ThomasNyman Thank you for your detailed response, looking at the question you are correct I feel. I think talking about kexec will probably just needlessly complicate things for the target audience or this question. And you also make a good point regarding boot-loader errors.
      – Vality
      Apr 4 '14 at 16:42










    • I had never noticed that little SysRq written under print screen! This is awesome. I wish I had known this when I was learning kernel module programming!
      – Shahbaz
      Apr 5 '14 at 18:20














    up vote
    43
    down vote



    accepted










    A couple of things come to mind:




    • Recover from a kernel panic



      A kernel panic, by definition, cannot be recovered from without restarting the kernel.




    • Recover from hangs which leave you without terminal access



      If the system is unresponsive and you're stranded without a way to issue commands to recover, the only thing you might be able to do is to reboot. Usually, you'd want to avoid manual power cycling. For these kinds of situations, the Linux kernel has Magic SysRq support which can be used to reboot the machine in an emergency.



      As long as CONFIG_MAGIC_SYSRQ option has been enabled in the kernel configuration, and the kernel.sysrq sysctl option is enabled, you can issue commands directly to the kernel with magic SysRq key combinations:



      Note that Alt+SysRq below means press and hold down Alt, then press and hold SysRq (typically the PrintScrn key).




      1. Alt+SysRq+r: regain control of keyboard


      2. Alt+SysRq+e: send SIGTERM to all processes, except init, giving them a chance to terminate gracefully


      3. Alt+SysRq+i: send SIGKILL to all processes, except init, forcing them to terminate


      4. Alt+SysRq+s: attempt to sync all mounted filesystems


      5. Alt+SysRq+u: remount all filesystem read-only


      6. Alt+SysRq+b: reboot, or



        Alt+SysRq+o: shutdown



      A mnemonic for the magic SysRq key combinations to attempt a graceful reboot is:



      "Reboot Even If System Utterly Broke"



      For headless servers, there's even an iptables target enabling remote SysRq sequences over a network.




    • Recover from unbootable state



      If the system has already been brought to a state where a regular boot is not possible (e.g. as a result of a failed system upgrade, corrupt filesystem etc.), then the only way to access a recovery console on the system might be to reboot using appropriate boot-time options.




    • Change boot-time kernel parameters



      Some kernel parameters (e.g. audit to enable / disable kernel auditing) can only be set when the kernel is loaded at boot-time.







    share|improve this answer


















    • 3




      "Reboot Even If System Utterly Broke" I'm favoriting this question just in case, but I don't think I'll ever forget that.
      – embedded.kyle
      Apr 4 '14 at 13:16






    • 1




      It is possibly worth noting you can get out of a panic using a kexec and avoid a complete reboot. This also applies equally to the getting out of unbootable state point. (they are not the same thing by any means, at least on an x86 system). However +1 for the rest of this answer.
      – Vality
      Apr 4 '14 at 13:55










    • @Vality Thanks for your comment. If kexec entails a reboot depends perhaps to a certain extent on ones point of view. The kdump documentation for instance describes kexec-on-panic as a reboot which preserves the system kernel's memory image. As for the point about unbootable state, I also considered things like bootloader misconfiguration (e.g. failure to load kernel in the first place), where kexec does not help. Given the nature of the question, I think some difference of opinion regarding semantics is unavoidable.
      – Thomas Nyman
      Apr 4 '14 at 16:37










    • @ThomasNyman Thank you for your detailed response, looking at the question you are correct I feel. I think talking about kexec will probably just needlessly complicate things for the target audience or this question. And you also make a good point regarding boot-loader errors.
      – Vality
      Apr 4 '14 at 16:42










    • I had never noticed that little SysRq written under print screen! This is awesome. I wish I had known this when I was learning kernel module programming!
      – Shahbaz
      Apr 5 '14 at 18:20












    up vote
    43
    down vote



    accepted







    up vote
    43
    down vote



    accepted






    A couple of things come to mind:




    • Recover from a kernel panic



      A kernel panic, by definition, cannot be recovered from without restarting the kernel.




    • Recover from hangs which leave you without terminal access



      If the system is unresponsive and you're stranded without a way to issue commands to recover, the only thing you might be able to do is to reboot. Usually, you'd want to avoid manual power cycling. For these kinds of situations, the Linux kernel has Magic SysRq support which can be used to reboot the machine in an emergency.



      As long as CONFIG_MAGIC_SYSRQ option has been enabled in the kernel configuration, and the kernel.sysrq sysctl option is enabled, you can issue commands directly to the kernel with magic SysRq key combinations:



      Note that Alt+SysRq below means press and hold down Alt, then press and hold SysRq (typically the PrintScrn key).




      1. Alt+SysRq+r: regain control of keyboard


      2. Alt+SysRq+e: send SIGTERM to all processes, except init, giving them a chance to terminate gracefully


      3. Alt+SysRq+i: send SIGKILL to all processes, except init, forcing them to terminate


      4. Alt+SysRq+s: attempt to sync all mounted filesystems


      5. Alt+SysRq+u: remount all filesystem read-only


      6. Alt+SysRq+b: reboot, or



        Alt+SysRq+o: shutdown



      A mnemonic for the magic SysRq key combinations to attempt a graceful reboot is:



      "Reboot Even If System Utterly Broke"



      For headless servers, there's even an iptables target enabling remote SysRq sequences over a network.




    • Recover from unbootable state



      If the system has already been brought to a state where a regular boot is not possible (e.g. as a result of a failed system upgrade, corrupt filesystem etc.), then the only way to access a recovery console on the system might be to reboot using appropriate boot-time options.




    • Change boot-time kernel parameters



      Some kernel parameters (e.g. audit to enable / disable kernel auditing) can only be set when the kernel is loaded at boot-time.







    share|improve this answer














    A couple of things come to mind:




    • Recover from a kernel panic



      A kernel panic, by definition, cannot be recovered from without restarting the kernel.




    • Recover from hangs which leave you without terminal access



      If the system is unresponsive and you're stranded without a way to issue commands to recover, the only thing you might be able to do is to reboot. Usually, you'd want to avoid manual power cycling. For these kinds of situations, the Linux kernel has Magic SysRq support which can be used to reboot the machine in an emergency.



      As long as CONFIG_MAGIC_SYSRQ option has been enabled in the kernel configuration, and the kernel.sysrq sysctl option is enabled, you can issue commands directly to the kernel with magic SysRq key combinations:



      Note that Alt+SysRq below means press and hold down Alt, then press and hold SysRq (typically the PrintScrn key).




      1. Alt+SysRq+r: regain control of keyboard


      2. Alt+SysRq+e: send SIGTERM to all processes, except init, giving them a chance to terminate gracefully


      3. Alt+SysRq+i: send SIGKILL to all processes, except init, forcing them to terminate


      4. Alt+SysRq+s: attempt to sync all mounted filesystems


      5. Alt+SysRq+u: remount all filesystem read-only


      6. Alt+SysRq+b: reboot, or



        Alt+SysRq+o: shutdown



      A mnemonic for the magic SysRq key combinations to attempt a graceful reboot is:



      "Reboot Even If System Utterly Broke"



      For headless servers, there's even an iptables target enabling remote SysRq sequences over a network.




    • Recover from unbootable state



      If the system has already been brought to a state where a regular boot is not possible (e.g. as a result of a failed system upgrade, corrupt filesystem etc.), then the only way to access a recovery console on the system might be to reboot using appropriate boot-time options.




    • Change boot-time kernel parameters



      Some kernel parameters (e.g. audit to enable / disable kernel auditing) can only be set when the kernel is loaded at boot-time.








    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Apr 4 '14 at 11:35

























    answered Apr 4 '14 at 9:40









    Thomas Nyman

    19.3k74868




    19.3k74868







    • 3




      "Reboot Even If System Utterly Broke" I'm favoriting this question just in case, but I don't think I'll ever forget that.
      – embedded.kyle
      Apr 4 '14 at 13:16






    • 1




      It is possibly worth noting you can get out of a panic using a kexec and avoid a complete reboot. This also applies equally to the getting out of unbootable state point. (they are not the same thing by any means, at least on an x86 system). However +1 for the rest of this answer.
      – Vality
      Apr 4 '14 at 13:55










    • @Vality Thanks for your comment. If kexec entails a reboot depends perhaps to a certain extent on ones point of view. The kdump documentation for instance describes kexec-on-panic as a reboot which preserves the system kernel's memory image. As for the point about unbootable state, I also considered things like bootloader misconfiguration (e.g. failure to load kernel in the first place), where kexec does not help. Given the nature of the question, I think some difference of opinion regarding semantics is unavoidable.
      – Thomas Nyman
      Apr 4 '14 at 16:37










    • @ThomasNyman Thank you for your detailed response, looking at the question you are correct I feel. I think talking about kexec will probably just needlessly complicate things for the target audience or this question. And you also make a good point regarding boot-loader errors.
      – Vality
      Apr 4 '14 at 16:42










    • I had never noticed that little SysRq written under print screen! This is awesome. I wish I had known this when I was learning kernel module programming!
      – Shahbaz
      Apr 5 '14 at 18:20












    • 3




      "Reboot Even If System Utterly Broke" I'm favoriting this question just in case, but I don't think I'll ever forget that.
      – embedded.kyle
      Apr 4 '14 at 13:16






    • 1




      It is possibly worth noting you can get out of a panic using a kexec and avoid a complete reboot. This also applies equally to the getting out of unbootable state point. (they are not the same thing by any means, at least on an x86 system). However +1 for the rest of this answer.
      – Vality
      Apr 4 '14 at 13:55










    • @Vality Thanks for your comment. If kexec entails a reboot depends perhaps to a certain extent on ones point of view. The kdump documentation for instance describes kexec-on-panic as a reboot which preserves the system kernel's memory image. As for the point about unbootable state, I also considered things like bootloader misconfiguration (e.g. failure to load kernel in the first place), where kexec does not help. Given the nature of the question, I think some difference of opinion regarding semantics is unavoidable.
      – Thomas Nyman
      Apr 4 '14 at 16:37










    • @ThomasNyman Thank you for your detailed response, looking at the question you are correct I feel. I think talking about kexec will probably just needlessly complicate things for the target audience or this question. And you also make a good point regarding boot-loader errors.
      – Vality
      Apr 4 '14 at 16:42










    • I had never noticed that little SysRq written under print screen! This is awesome. I wish I had known this when I was learning kernel module programming!
      – Shahbaz
      Apr 5 '14 at 18:20







    3




    3




    "Reboot Even If System Utterly Broke" I'm favoriting this question just in case, but I don't think I'll ever forget that.
    – embedded.kyle
    Apr 4 '14 at 13:16




    "Reboot Even If System Utterly Broke" I'm favoriting this question just in case, but I don't think I'll ever forget that.
    – embedded.kyle
    Apr 4 '14 at 13:16




    1




    1




    It is possibly worth noting you can get out of a panic using a kexec and avoid a complete reboot. This also applies equally to the getting out of unbootable state point. (they are not the same thing by any means, at least on an x86 system). However +1 for the rest of this answer.
    – Vality
    Apr 4 '14 at 13:55




    It is possibly worth noting you can get out of a panic using a kexec and avoid a complete reboot. This also applies equally to the getting out of unbootable state point. (they are not the same thing by any means, at least on an x86 system). However +1 for the rest of this answer.
    – Vality
    Apr 4 '14 at 13:55












    @Vality Thanks for your comment. If kexec entails a reboot depends perhaps to a certain extent on ones point of view. The kdump documentation for instance describes kexec-on-panic as a reboot which preserves the system kernel's memory image. As for the point about unbootable state, I also considered things like bootloader misconfiguration (e.g. failure to load kernel in the first place), where kexec does not help. Given the nature of the question, I think some difference of opinion regarding semantics is unavoidable.
    – Thomas Nyman
    Apr 4 '14 at 16:37




    @Vality Thanks for your comment. If kexec entails a reboot depends perhaps to a certain extent on ones point of view. The kdump documentation for instance describes kexec-on-panic as a reboot which preserves the system kernel's memory image. As for the point about unbootable state, I also considered things like bootloader misconfiguration (e.g. failure to load kernel in the first place), where kexec does not help. Given the nature of the question, I think some difference of opinion regarding semantics is unavoidable.
    – Thomas Nyman
    Apr 4 '14 at 16:37












    @ThomasNyman Thank you for your detailed response, looking at the question you are correct I feel. I think talking about kexec will probably just needlessly complicate things for the target audience or this question. And you also make a good point regarding boot-loader errors.
    – Vality
    Apr 4 '14 at 16:42




    @ThomasNyman Thank you for your detailed response, looking at the question you are correct I feel. I think talking about kexec will probably just needlessly complicate things for the target audience or this question. And you also make a good point regarding boot-loader errors.
    – Vality
    Apr 4 '14 at 16:42












    I had never noticed that little SysRq written under print screen! This is awesome. I wish I had known this when I was learning kernel module programming!
    – Shahbaz
    Apr 5 '14 at 18:20




    I had never noticed that little SysRq written under print screen! This is awesome. I wish I had known this when I was learning kernel module programming!
    – Shahbaz
    Apr 5 '14 at 18:20












    up vote
    2
    down vote













    There are two times I can think of where I would want to reboot:




    1. When I need to make sure that the system can boot up in the proper state.



      I once worked on a system that had some daemon configured while it was running. After it ran for a few years, a power failure caused it to reboot, but the daemon was not part of the startup process and nobody had a clue how it had been configured years earlier. The system was down for days while we figured out how to reconfigure it.



      Actually rebooting is the only way to know for sure that your system will restart properly after a power failure.




    2. When a system library has been updated.



      Let's say that a major security flaw has been discovered in a library that's shared with many apps/servers on the system. You can update the library without rebooting, but how many processes are still running with the insecure library loaded? You can painstakingly restart anything using the old library (if you can figure it out), but that is error prone and can take longer than just rebooting.



      Rebooting is the best way to be sure that all running processes are not still using the old, buggy library.







    share|improve this answer




















    • There are better ways to find all binaries depending on a certain library if you use a good package manager. revdep-rebuilt from Gentoo comes to mind.
      – Spidey
      Apr 5 '14 at 0:34






    • 1




      @Spidey: Once you rebuild those binaries, how do you ensure that there are no old processes running with the buggy library?
      – Gabe
      Apr 5 '14 at 2:30






    • 1




      How do you know which daemons have the offending libraries loaded?
      – Gabe
      Apr 5 '14 at 2:48






    • 1




      @Gabe You could for instance check which processes have the libraries mapped to their memory space using lsof before you upgrade the libraries.
      – Thomas Nyman
      Apr 5 '14 at 11:32






    • 1




      @Gabe Sure, and while I agree that that's a perfectly good reason to reboot, the OP is explicitly not asking in which cases a reboot is more conventient, but when a reboot is absolutely necessary.
      – Thomas Nyman
      Apr 5 '14 at 19:44














    up vote
    2
    down vote













    There are two times I can think of where I would want to reboot:




    1. When I need to make sure that the system can boot up in the proper state.



      I once worked on a system that had some daemon configured while it was running. After it ran for a few years, a power failure caused it to reboot, but the daemon was not part of the startup process and nobody had a clue how it had been configured years earlier. The system was down for days while we figured out how to reconfigure it.



      Actually rebooting is the only way to know for sure that your system will restart properly after a power failure.




    2. When a system library has been updated.



      Let's say that a major security flaw has been discovered in a library that's shared with many apps/servers on the system. You can update the library without rebooting, but how many processes are still running with the insecure library loaded? You can painstakingly restart anything using the old library (if you can figure it out), but that is error prone and can take longer than just rebooting.



      Rebooting is the best way to be sure that all running processes are not still using the old, buggy library.







    share|improve this answer




















    • There are better ways to find all binaries depending on a certain library if you use a good package manager. revdep-rebuilt from Gentoo comes to mind.
      – Spidey
      Apr 5 '14 at 0:34






    • 1




      @Spidey: Once you rebuild those binaries, how do you ensure that there are no old processes running with the buggy library?
      – Gabe
      Apr 5 '14 at 2:30






    • 1




      How do you know which daemons have the offending libraries loaded?
      – Gabe
      Apr 5 '14 at 2:48






    • 1




      @Gabe You could for instance check which processes have the libraries mapped to their memory space using lsof before you upgrade the libraries.
      – Thomas Nyman
      Apr 5 '14 at 11:32






    • 1




      @Gabe Sure, and while I agree that that's a perfectly good reason to reboot, the OP is explicitly not asking in which cases a reboot is more conventient, but when a reboot is absolutely necessary.
      – Thomas Nyman
      Apr 5 '14 at 19:44












    up vote
    2
    down vote










    up vote
    2
    down vote









    There are two times I can think of where I would want to reboot:




    1. When I need to make sure that the system can boot up in the proper state.



      I once worked on a system that had some daemon configured while it was running. After it ran for a few years, a power failure caused it to reboot, but the daemon was not part of the startup process and nobody had a clue how it had been configured years earlier. The system was down for days while we figured out how to reconfigure it.



      Actually rebooting is the only way to know for sure that your system will restart properly after a power failure.




    2. When a system library has been updated.



      Let's say that a major security flaw has been discovered in a library that's shared with many apps/servers on the system. You can update the library without rebooting, but how many processes are still running with the insecure library loaded? You can painstakingly restart anything using the old library (if you can figure it out), but that is error prone and can take longer than just rebooting.



      Rebooting is the best way to be sure that all running processes are not still using the old, buggy library.







    share|improve this answer












    There are two times I can think of where I would want to reboot:




    1. When I need to make sure that the system can boot up in the proper state.



      I once worked on a system that had some daemon configured while it was running. After it ran for a few years, a power failure caused it to reboot, but the daemon was not part of the startup process and nobody had a clue how it had been configured years earlier. The system was down for days while we figured out how to reconfigure it.



      Actually rebooting is the only way to know for sure that your system will restart properly after a power failure.




    2. When a system library has been updated.



      Let's say that a major security flaw has been discovered in a library that's shared with many apps/servers on the system. You can update the library without rebooting, but how many processes are still running with the insecure library loaded? You can painstakingly restart anything using the old library (if you can figure it out), but that is error prone and can take longer than just rebooting.



      Rebooting is the best way to be sure that all running processes are not still using the old, buggy library.








    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Apr 4 '14 at 22:46









    Gabe

    1573




    1573











    • There are better ways to find all binaries depending on a certain library if you use a good package manager. revdep-rebuilt from Gentoo comes to mind.
      – Spidey
      Apr 5 '14 at 0:34






    • 1




      @Spidey: Once you rebuild those binaries, how do you ensure that there are no old processes running with the buggy library?
      – Gabe
      Apr 5 '14 at 2:30






    • 1




      How do you know which daemons have the offending libraries loaded?
      – Gabe
      Apr 5 '14 at 2:48






    • 1




      @Gabe You could for instance check which processes have the libraries mapped to their memory space using lsof before you upgrade the libraries.
      – Thomas Nyman
      Apr 5 '14 at 11:32






    • 1




      @Gabe Sure, and while I agree that that's a perfectly good reason to reboot, the OP is explicitly not asking in which cases a reboot is more conventient, but when a reboot is absolutely necessary.
      – Thomas Nyman
      Apr 5 '14 at 19:44
















    • There are better ways to find all binaries depending on a certain library if you use a good package manager. revdep-rebuilt from Gentoo comes to mind.
      – Spidey
      Apr 5 '14 at 0:34






    • 1




      @Spidey: Once you rebuild those binaries, how do you ensure that there are no old processes running with the buggy library?
      – Gabe
      Apr 5 '14 at 2:30






    • 1




      How do you know which daemons have the offending libraries loaded?
      – Gabe
      Apr 5 '14 at 2:48






    • 1




      @Gabe You could for instance check which processes have the libraries mapped to their memory space using lsof before you upgrade the libraries.
      – Thomas Nyman
      Apr 5 '14 at 11:32






    • 1




      @Gabe Sure, and while I agree that that's a perfectly good reason to reboot, the OP is explicitly not asking in which cases a reboot is more conventient, but when a reboot is absolutely necessary.
      – Thomas Nyman
      Apr 5 '14 at 19:44















    There are better ways to find all binaries depending on a certain library if you use a good package manager. revdep-rebuilt from Gentoo comes to mind.
    – Spidey
    Apr 5 '14 at 0:34




    There are better ways to find all binaries depending on a certain library if you use a good package manager. revdep-rebuilt from Gentoo comes to mind.
    – Spidey
    Apr 5 '14 at 0:34




    1




    1




    @Spidey: Once you rebuild those binaries, how do you ensure that there are no old processes running with the buggy library?
    – Gabe
    Apr 5 '14 at 2:30




    @Spidey: Once you rebuild those binaries, how do you ensure that there are no old processes running with the buggy library?
    – Gabe
    Apr 5 '14 at 2:30




    1




    1




    How do you know which daemons have the offending libraries loaded?
    – Gabe
    Apr 5 '14 at 2:48




    How do you know which daemons have the offending libraries loaded?
    – Gabe
    Apr 5 '14 at 2:48




    1




    1




    @Gabe You could for instance check which processes have the libraries mapped to their memory space using lsof before you upgrade the libraries.
    – Thomas Nyman
    Apr 5 '14 at 11:32




    @Gabe You could for instance check which processes have the libraries mapped to their memory space using lsof before you upgrade the libraries.
    – Thomas Nyman
    Apr 5 '14 at 11:32




    1




    1




    @Gabe Sure, and while I agree that that's a perfectly good reason to reboot, the OP is explicitly not asking in which cases a reboot is more conventient, but when a reboot is absolutely necessary.
    – Thomas Nyman
    Apr 5 '14 at 19:44




    @Gabe Sure, and while I agree that that's a perfectly good reason to reboot, the OP is explicitly not asking in which cases a reboot is more conventient, but when a reboot is absolutely necessary.
    – Thomas Nyman
    Apr 5 '14 at 19:44










    up vote
    0
    down vote













    If you mean planned changes in the software configuration and assume perfectly working hardware (I haven't seen such yet) and bug-free software (you know ...), then only a bug in the kernel or a driver would force you to reboot. :)



    Other than that ... I'm not sure if it would be possible to replace init without switching to single user mode and doing some magic which is essentially not much different than a reboot.






    share|improve this answer
























      up vote
      0
      down vote













      If you mean planned changes in the software configuration and assume perfectly working hardware (I haven't seen such yet) and bug-free software (you know ...), then only a bug in the kernel or a driver would force you to reboot. :)



      Other than that ... I'm not sure if it would be possible to replace init without switching to single user mode and doing some magic which is essentially not much different than a reboot.






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        If you mean planned changes in the software configuration and assume perfectly working hardware (I haven't seen such yet) and bug-free software (you know ...), then only a bug in the kernel or a driver would force you to reboot. :)



        Other than that ... I'm not sure if it would be possible to replace init without switching to single user mode and doing some magic which is essentially not much different than a reboot.






        share|improve this answer












        If you mean planned changes in the software configuration and assume perfectly working hardware (I haven't seen such yet) and bug-free software (you know ...), then only a bug in the kernel or a driver would force you to reboot. :)



        Other than that ... I'm not sure if it would be possible to replace init without switching to single user mode and doing some magic which is essentially not much different than a reboot.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 4 '14 at 9:17









        Zrin

        28616




        28616



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f123088%2fwhen-is-a-reboot-required%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            Peggy Mitchell

            The Forum (Inglewood, California)

            Palaiologos