home *** CD-ROM | disk | FTP | other *** search
/ Chip 1995 March / CHIP3.mdf / slackwar / a / util / util-lin.2 / util-lin / util-linux-2.2 / example.files / rc < prev    next >
Encoding:
Text File  |  1995-02-22  |  2.4 KB  |  80 lines

  1. # rc file for The Linux BOGUS Release, version 1.0.1
  2.  
  3.                                 echo "Running /etc/rc. . ."
  4.  
  5. PATH=/sbin:/usr/sbin:/bin:/usr/bin; export PATH
  6.  
  7. # Update (bdflush) performs flushes dirty buffers back to disk and
  8. # performs a sync every 30 seconds.
  9.                                 echo "Starting update"
  10. update &
  11.  
  12. if [ -f /fastboot ]
  13. then
  14.                                 echo "Skipping file system check"
  15. else
  16.                                 echo "Performing file system check"
  17.     fsck -AV -a
  18.     # If there was a failure, drop into single-user mode.
  19.     # NOTE: This is not secure.  If security is needed, make sure than
  20.     #       /etc/securesingle exists and "reboot single".  simipleinit
  21.     #       will then prompt for root's password.
  22.     if [ $? -gt 1 ]
  23.     then
  24.         echo "Warning: fsck FAILED"
  25.         echo "         Starting single user shell"
  26.         echo "         Fix filesystem and REBOOT"
  27.         sh -si < /dev/console > /dev/console 2>&1
  28.     fi
  29. fi
  30.  
  31.                                 echo "Mounting file systems"
  32. # Remount the root filesystem in read-write mode
  33. mount -n -o rw,remount /
  34.  
  35. # Remove the fastboot check file
  36. rm -f /fastboot
  37.  
  38. # Remove /etc/mtab* so mount creates the /etc/mtab file
  39. rm -f /etc/mtab*
  40.  
  41. # Mount all partitions specified in /etc/fstab
  42. mount -avt nonfs,nomsdos,nohpfs
  43.  
  44. # Mount swap partition specified in /etc/fstab
  45. swapon -a
  46.  
  47.                                 echo -n "Initialization: "
  48. # Update ps database
  49. if [ -f /usr/sbin/psupdate -a -f /usr/src/linux/vmlinux ]; then
  50.                                 echo -n "psdatabase "
  51.     /usr/sbin/psupdate /usr/src/linux/vmlinux
  52. fi
  53.  
  54. # tmp and usr may be mounted, so we do these rm's after mount
  55.                                 echo -n "locks "
  56. rm -f /var/lock/LCK*
  57.                                 echo -n "pids "
  58. rm -f /var/run/*
  59.                                 echo -n "/tmp "
  60. rm -rf /tmp; mkdir /tmp; chmod 1777 /tmp
  61.  
  62. # Remove /var/adm/utmp and touch it
  63.                                 echo -n "utmp "
  64. if [ ! -e /var ]; then mkdir /var; chmod 755 /var; fi
  65. if [ ! -e /var/adm ]; then mkdir /var/adm; chmod 755 /var/adm; fi
  66. rm -f /var/adm/utmp
  67. touch /var/adm/utmp
  68. chmod 644 /var/adm/utmp
  69.  
  70.                                 echo ""
  71.                                 echo "Running rc.local. . ."
  72. sh /etc/rc.local
  73.  
  74. # Allow logins
  75.                                 echo "Allowing logins"
  76. rm -f /etc/nologin
  77.  
  78. date
  79. exit 0
  80.