OpenSDE Packages Database (without history before r20070)
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.

75 lines
1.8 KiB

  1. #!/bin/sh
  2. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # T2 SDE: package/.../sysfiles/etc_rc.d_rc.txt
  6. # Copyright (C) 2004 - 2006 The T2 SDE Project
  7. # Copyright (C) 1998 - 2003 Clifford Wolf
  8. #
  9. # More information can be found in the files COPYING and README.
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; version 2 of the License. A copy of the
  14. # GNU General Public License can be found in the file COPYING.
  15. # --- T2-COPYRIGHT-NOTE-END ---
  16. #
  17. # ROCK Linux: /etc/rc.d/rc
  18. #
  19. # This script does the switching between runlevels.
  20. #
  21. {
  22. export PATH=/bin:/sbin:/usr/bin:/usr/sbin
  23. echo "** running rc script **"
  24. echo "RC: Previous runlevel: $PREVLEVEL, new runlevel: $RUNLEVEL."
  25. curdir=/etc/rc.d/rc$RUNLEVEL.d
  26. prevdir=/etc/rc.d/rc$PREVLEVEL.d
  27. #
  28. # run the KILL scripts of the previous runlevel (if needed)
  29. #
  30. if ! [ $PREVLEVEL = S -o $PREVLEVEL = N ]
  31. then
  32. echo "RC: Leave runlevel $PREVLEVEL ..."
  33. for i in $prevdir/K*; do
  34. if ! test -x "$i" ; then
  35. echo "Warning: $i is not executable: skipped."
  36. continue
  37. fi
  38. x="`echo "$i" | sed "s,$prevdir/K..,$curdir/S??,"`"
  39. [ "`echo $x`" = "$x" ] || continue
  40. /sbin/rc --nobtee $i stop
  41. done
  42. fi
  43. echo "RC: Enter runlevel $RUNLEVEL ..."
  44. if [ $RUNLEVEL != 0 -a $RUNLEVEL != 6 -a $RUNLEVEL != S ]
  45. then
  46. #
  47. # run the START scripts of the current (new) runlevel
  48. #
  49. for i in $curdir/S*; do
  50. if ! test -x "$i" ; then
  51. echo "Warning: $i is not executable: skipped."
  52. continue
  53. fi
  54. x="`echo "$i" | sed "s,$curdir/S..,$prevdir/K??,"`"
  55. [ "`echo $x`" = "$x" ] || continue
  56. /sbin/rc --nobtee $i start
  57. done
  58. fi
  59. echo "RC: The system is now in runlevel $RUNLEVEL."
  60. # write EOT mark for btee
  61. echo -ne '\004'
  62. } 2>&1 | /sbin/btee a /var/log/init.msg
  63. exit 0