home *** CD-ROM | disk | FTP | other *** search
/ Chip 1995 March / CHIP3.mdf / slackwar / a / util / util-lin.10 / util-lin / util-linux-1.10 / example.files / rc < prev    next >
Encoding:
Text File  |  1994-04-26  |  1.5 KB  |  62 lines

  1. # /etc/rc - generic (to Linux) system startup file (runtime configuration)
  2.  
  3. echo "running /etc/rc..."
  4.  
  5. PATH=/sbin:/usr/sbin:/bin:/usr/bin; export PATH
  6.  
  7. # bdflush performs flushes dirty buffers back to disk and performs a syn
  8. # every 30 seconds.  therefore, it replaces update.
  9. bdflush &
  10.  
  11. if [ -f /fastboot ]
  12. then
  13.     echo Skipping fcsk
  14. else
  15.     fsck -AV -a
  16.     # If there was a failure, drop into single-user mode.
  17.     # NOTE: This is not secure.  If security is needed, make sure than
  18.     #       /etc/securesinlge exists and "reboot single".  simipleinit
  19.     #       will then prompt for root's password.
  20.     if [ $? -gt 1 ]
  21.     then
  22.         echo "Warning: fsck FAILED"
  23.         echo "         Starting single user shell"
  24.         echo "         Fix filesystem and REBOOT"
  25.         sh -si < /dev/console > /dev/console 2>&1
  26.     fi
  27. fi
  28.  
  29. # Remount the root filesystem in read-write mode
  30. mount -n -o remount /dev/sda2 /
  31.  
  32. # remove /etc/mtab* so mount creates the /etc/mtab file
  33. rm -f /etc/mtab* /etc/nologin /fastboot
  34.  
  35. # mount all partitions specified in /etc/fstab
  36. mount -av
  37. # mount swap partition specified in /etc/fstab
  38. swapon -a
  39.  
  40. # Preserve elvis files in case of a crash
  41. elvprsv "-the system went down" /tmp/elv_*.*
  42.  
  43. # tmp and usr may be mounted, so we do these rm's after mount
  44. rm -f /var/lock/LCK*
  45. rm -rf /tmp; mkdir /tmp; chmod 777 /tmp
  46.  
  47. # remove /etc/utmp and touch it
  48. rm -f /etc/utmp
  49. touch /etc/utmp
  50.  
  51. # start up cron if it exists
  52. if [ -f /etc/crond ]; then
  53.     /etc/crond
  54. fi
  55.  
  56. # update ps database
  57. if [ -f /sbin/psupdate ]; then
  58.     /sbin/psupdate
  59. fi
  60.  
  61. sh /etc/rc.local
  62.