README 1.1 KB

123456789101112131415161718192021222324252627282930
  1. # Replaces traditional overdesigned shutdown mechanism.
  2. #
  3. # No communication with init is necessary:
  4. # just ask all processes to exit.
  5. # Then unmount everything. Then reboot or power off.
  6. # Install /sbin/ symlinks named halt, reboot, poweroff
  7. # (and also possibly shutdown) to e.g.
  8. # /app/shutdown-1.0/script/shutdown:
  9. #
  10. ln -s /app/shutdown-1.0/script/shutdown /sbin/halt
  11. ln -s /app/shutdown-1.0/script/shutdown /sbin/reboot
  12. ln -s /app/shutdown-1.0/script/shutdown /sbin/poweroff
  13. #
  14. # shutdown spawns do_shutdown in new session, redirected to /dev/null,
  15. # tells user that shutdown is in progress, and sleeps
  16. # (for cosmetic reasons: do not confuse user by letting him
  17. # type more commands in this terminal).
  18. #
  19. # do_shutdown tries to switch to a VT console.
  20. # Then, (only if -r) it spawns a hardshutdown child, to reboot
  21. # unconditionally in 30 seconds if something later goes seriously bad.
  22. # Then it runs stop_tasks, writing to /var/log/reboot/YYYYMMDDhhmmss.log,
  23. # then it runs stop_storage.
  24. # Then it commands kernel to halt/reboot/poweroff, if requested.
  25. # Then it sleeps forever.
  26. #
  27. # Build the hardshutdown binary:
  28. #
  29. cd script && ./hardshutdown.make.sh