1

I'm developing a Jetson-based HUD that reboots very quickly. During the reboot process, I noticed that it takes about 10 seconds (relatively long) just to shut down the OS when using the "reboot" command. Since I need an OS that can reboot within approximately 10 seconds, achieving my goal is not possible with a 10-second shutdown alone. Therefore, instead of the reboot command, I tried rebooting using the command sudo echo b > /proc/sysrq-trigger, which immediately performs the reboot without any noticeable processing time. Based on my research, I found that this method does not involve synchronizing the file system or unmounting it.

Could implementing the OS reboot functionality in this way pose a risk of serious errors or bugs in the system?

Would using the sudo echo b > /proc/sysrq-trigger command periodically cause significant issues for the system?

0andriy
  • 4,183
  • 1
  • 24
  • 37
이하운
  • 11
  • 2
  • 2
    If you have no filesystem mounted read-write, it may be safe. It depends. Echoing `s` to sync buffers before reboot may improve safety, but not absolutely: any process can write after sync but before reboot. Better way is to investigate why "normal" reboot is so long, eliminate the reason and unmount filesystems politely. By the way, `sudo` in your command is redundant: it affects only `echo` command but `/proc/sysrq-trigger` is opened by shell before `sudo` executed. – dimich Jun 10 '23 at 03:50
  • The code for shutdown is available. You could make your own stripped down version with shorter waits. – stark Jun 11 '23 at 12:00
  • Maybe this is fast enough: reboot -f -f – S_IROTH Jun 11 '23 at 20:53
  • You should check why the normal reboot takes more time. In other words: why daemons want to shut down in a clean way, and so, do it matter to you? (and you should answer yourself to each shutdown process, so only you can know if it is safe for your usecase) Note: Internet do not want fast reboots (read the RFC why it may cause problems). – Giacomo Catenazzi Jun 12 '23 at 08:32

0 Answers0