#! /bin/sh
#
# clean up local filesystems
#

#locate and source functions script
source `PATH=$INIT_D/:/sbin/init.d:/etc/init.d:/etc/rc.d type -p functions`

case "$1" in
  start)
     need $mounted_filesystems || exit_if_any_error
          
     echo 'Clearing /var/lock/ and /var/run/ ...'
     rm -f /var/lock/* && rm -f /var/run/*
     up_evaluate_retval

     #create new utmp file
     echo 'Creating new /var/run/utmp...'
     touch /var/run/utmp && chmod 644 /var/run/utmp
     up_evaluate_retval
 
     echo 'Removing nologin, fastboot, forcefsck...'
     rm -f /etc/nologin /nologin /fastboot /forcefsck
     up_evaluate_retval
     ;;
  stop)
     ;;
  *)
     exit 1
     ;;
esac
    
exit 0
