home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / etc / init.d / readahead < prev    next >
Encoding:
Text File  |  2006-02-24  |  1.4 KB  |  57 lines

  1. #!/bin/sh -e
  2. # init script for readahead
  3.  
  4. # Check the package is still installed
  5. [ -x /sbin/readahead-list ] || exit 0
  6.  
  7. # Get LSB functions
  8. . /lib/lsb/init-functions
  9. . /etc/default/rcS
  10.  
  11.  
  12. # Remember that any major changes to this script need to also be made to
  13. # readahead-desktop.init
  14.  
  15. case "$1" in
  16.     start|restart|force-reload)
  17.     # If "profile" is placed on the kernel command-line we watch the boot
  18.     # sequence and generate new readahead lists, rather than read the lists
  19.     if ! grep -q "profile" /proc/cmdline; then
  20.         log_begin_msg "Reading files needed to boot..."
  21.         if /sbin/start-stop-daemon --start --quiet --background \
  22.         --pidfile /var/run/readahead-list.bogus \
  23.         --startas /sbin/readahead-list -- /etc/readahead/boot; then
  24.         log_end_msg 0
  25.         else
  26.         log_end_msg $?
  27.         fi
  28.     else
  29.         # This can take a while
  30.         if type usplash_write >/dev/null 2>&1; then
  31.         usplash_write "TIMEOUT 360" || true
  32.         fi
  33.  
  34.         log_begin_msg "Preparing to profile boot sequence..."
  35.         if /sbin/start-stop-daemon --start --quiet \
  36.         --pidfile /var/run/readahead-watch.bogus \
  37.         --startas /sbin/readahead-watch -- -o /etc/readahead/boot; then
  38.         log_end_msg 0    
  39.         else
  40.         log_end_msg $? || true
  41.         fi 
  42.  
  43.         if type usplash_write >/dev/null 2>&1; then
  44.         usplash_write "TIMEOUT 15" || true
  45.         fi
  46.     fi
  47.     ;;
  48.     stop)
  49.     ;;
  50.     *)
  51.     echo "Usage: /etc/init.d/readahead {start|stop|restart|force-reload}"
  52.     exit 1
  53.     ;;
  54. esac
  55.  
  56. exit 0
  57.