mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.2 KiB

  1. #!/bin/sh
  2. #
  3. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  4. #
  5. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  6. # Please add additional copyright information _after_ the line containing
  7. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  8. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  9. #
  10. # ROCK Linux: rock-src/package/base/sysfiles/system.init
  11. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  12. #
  13. # This program is free software; you can redistribute it and/or modify
  14. # it under the terms of the GNU General Public License as published by
  15. # the Free Software Foundation; either version 2 of the License, or
  16. # (at your option) any later version. A copy of the GNU General Public
  17. # License can be found at Documentation/COPYING.
  18. #
  19. # Many people helped and are helping developing ROCK Linux. Please
  20. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  21. # file for details.
  22. #
  23. # --- ROCK-COPYRIGHT-NOTE-END ---
  24. #
  25. # Desc: System state save and restore
  26. # Runlevel: 07 rcX rc1 rc2 rc3 rc4 rc5
  27. #
  28. main_begin
  29. block_begin(start, `Refresh utmp, delete lock and tmp files and other stuff.')
  30. find /var/lock /var/run /tmp -mindepth 1 -print0 2> /dev/null | xargs --null rm -rf
  31. rm -f /etc/nologin /nologin /fastboot ; echo -n >> /var/run/utmp
  32. chmod 664 /var/run/utmp ; chown root:tty /var/run/utmp
  33. mkdir /tmp/.ICE-unix /var/lock/subsys
  34. chmod 1777 /tmp/.ICE-unix
  35. dnl
  36. block_split(`Writing /var/log/boot.msg.')
  37. check(`dmesg > /var/log/boot.msg')
  38. dnl
  39. block_split(`Initializing kernel random number generator.')
  40. if [ -e /var/state/random-seed ] ; then
  41. check(`cat /var/state/random-seed >/dev/urandom')
  42. fi
  43. block_end
  44. block_begin(stop, `Saving /var/log/init.msg and /var/log/boot.msg.')
  45. check(`echo -n >> /var/log/init.msg')
  46. check(`echo -n >> /var/log/boot.msg')
  47. check(`mv /var/log/init.msg /var/log/init.old')
  48. check(`mv /var/log/boot.msg /var/log/boot.old')
  49. block_split(`Writing a wtmp record.')
  50. if [ "$RUNLEVEL" = 0 ] ; then
  51. check(`halt -w')
  52. else
  53. check(`reboot -w')
  54. fi
  55. block_split(`Saving kernel random seed.')
  56. check(`dd if=/dev/urandom of=/var/state/random-seed count=1 2>/dev/null')
  57. block_end
  58. main_end