home *** CD-ROM | disk | FTP | other *** search
/ chilidog.highland.cc.ks.us / chilidog.highland.cc.ks.us.zip / chilidog.highland.cc.ks.us / backup / bradford.20101108.etc.tar.gz / bradford.20101108.etc.tar / etc / init.d / boot.ldconfig < prev    next >
Text File  |  2005-01-20  |  2KB  |  74 lines

  1. #! /bin/sh
  2. #
  3. # Copyright (c) 2001-2002 SuSE Linux AG, Nuernberg, Germany.
  4. # All rights reserved.
  5. #
  6. # /etc/init.d/boot.ldconfig
  7. #
  8. ### BEGIN INIT INFO
  9. # Provides:          boot.ldconfig
  10. # Required-Start:    boot.clock
  11. # Should-Start:      boot.crypto boot.swap
  12. # Required-Stop:
  13. # Default-Start:     B
  14. # Default-Stop:
  15. # Description:       run ldconfig if needed
  16. ### END INIT INFO
  17.  
  18. . /etc/rc.status
  19. . /etc/sysconfig/clock
  20.  
  21. rc_reset
  22.  
  23. case "$1" in
  24.   start|restart|stop)
  25.     #
  26.     # Let ld.so rebuild its cache.
  27.     # But do some tests before if it is really needed
  28.     LDCONFIG_NEEDED=false
  29.     test -s /etc/ld.so.cache || LDCONFIG_NEEDED=true
  30.     test "$run_ldconfig" = true && LDCONFIG_NEEDED=true
  31.     test -x /usr/bin/find -a "$LDCONFIG_NEEDED" = false && {
  32.         for DUMMY in `/usr/bin/find /etc/ld.so.cache -mtime +30` ; do
  33.         LDCONFIG_NEEDED=true
  34.         done
  35.     }
  36.     LIBDIRS="/lib /usr/lib /usr/local/lib"
  37.     test -s /etc/ld.so.conf && {
  38.         for DIR in `cat /etc/ld.so.conf` ; do
  39.         case $DIR in
  40.             /*)
  41.             test -d "$DIR" && LIBDIRS="$LIBDIRS $DIR"
  42.             ;;
  43.         esac
  44.         done
  45.     }
  46.     for DIR in $LIBDIRS ; do
  47.         test $DIR -nt /etc/ld.so.cache && {
  48.             LDCONFIG_NEEDED=true
  49.             break
  50.         }
  51.     done
  52.  
  53.     test -x /sbin/ldconfig -a "$LDCONFIG_NEEDED" = true && {
  54.         echo -n "Setting up linker cache (/etc/ld.so.cache) using ldconfig"
  55.         { /sbin/ldconfig -X 2>/dev/null || \
  56.             { echo ; echo -e "ldconfig $rc_failed" ; } ; } &
  57.         rc_status -v -r
  58.     }
  59.  
  60.  
  61.     ;;
  62.     status)
  63.     rc_failed 4
  64.     rc_status -v
  65.     ;;
  66.     *)
  67.     echo "Usage: $0 {start|stop|status|restart}"
  68.     exit 1
  69.     ;;
  70. esac
  71.  
  72. rc_exit
  73.  
  74.