Magellan Linux

Diff of /trunk/initscripts/sysvinit/rc/cleanfs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/magellan-initscripts/etc/rc.d/init.d/cleanfs revision 931 by niro, Thu Nov 5 12:57:14 2009 UTC trunk/initscripts/sysvinit/rc/cleanfs revision 1665 by niro, Fri Jan 20 23:01:04 2012 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/sh
2  # $Id$  # $Header: /home/cvsd/magellan-cvs/magellan-src/busybox-initscripts/rc/cleanfs,v 1.2 2008-06-10 22:23:30 niro Exp $
3    
4  #%rlevels: 7:s  #%rlevels: 7:s
5  #%start: 50  #%start: 50
# Line 13  Line 13 
13  source /etc/conf.d/rc  source /etc/conf.d/rc
14  source ${rc_functions}  source ${rc_functions}
15    
16  for dir in /tmp /var/run /var/lock  case "$1" in
17  do   start)
18   echo -e ${COLOREDSTAR}"Removing tmp files in ${dir}/* ..."   for dir in /tmp /run /var/lock
19   for file in $(find ${dir} -type f)   do
20   do   [ -d ${dir} ] || continue
21   [[ $(basename ${file}) = .keep ]] && continue   rc_print "Removing tmp files in ${dir}/ ..."
22   rm -f ${file}   for file in $(find ${dir} -type f)
23   done   do
24   evaluate_retval   [[ $(basename ${file}) = .keep ]] && continue
25  done   rm -f ${file}
26     done
27  echo -e ${COLOREDSTAR}"Creating new /var/run/utmp ..."   for subdir in $(find ${dir} -mindepth 1 -type d)
28  touch /var/run/utmp && chmod 644 /var/run/utmp   do
29  evaluate_retval   [[ -f ${subdir}/.keep ]] && continue
30     rm -r ${subdir}
31  echo -e ${COLOREDSTAR}"Creating new /var/run/wtmp ..."   done
32  touch /var/log/wtmp && chmod 644 /var/log/wtmp   evaluate_retval
33  evaluate_retval   done
34    
35  echo -e ${COLOREDSTAR}"Removing possible /etc/nologin /fastboot and /forcefsck ..."   rc_print "Creating new /run/utmp ..."
36  rm -f /etc/nologin /fastboot /forcefsck   touch /run/utmp && chmod 644 /run/utmp
37  evaluate_retval   evaluate_retval
38    
39  update_svcstatus $1   rc_print "Creating new /var/log/wtmp ..."
40  splash svc_started "$(basename $0)" 0   touch /var/log/wtmp && chmod 644 /var/log/wtmp
41     evaluate_retval
42    
43     rc_print "Removing possible /etc/nologin /fastboot and /forcefsck ..."
44     rm -f /etc/nologin /fastboot /forcefsck
45     evaluate_retval
46    
47     update_svcstatus $1
48     splash svc_started "$(basename $0)" 0
49     ;;
50    
51     *)
52     rc_echo "Usage: $0 {start}"
53     exit 1
54     ;;
55    esac

Legend:
Removed from v.931  
changed lines
  Added in v.1665