Magellan Linux

Contents of /trunk/initscripts/sysvinit/rc/cleanfs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1665 - (show annotations) (download)
Fri Jan 20 23:01:04 2012 UTC (12 years, 3 months ago) by niro
File size: 1121 byte(s)
-moved /var/run -> /run
1 #!/bin/sh
2 # $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
5 #%start: 50
6 #%stop:
7
8 #deps
9 #%needs:
10 #%before:
11 #%after:
12
13 source /etc/conf.d/rc
14 source ${rc_functions}
15
16 case "$1" in
17 start)
18 for dir in /tmp /run /var/lock
19 do
20 [ -d ${dir} ] || continue
21 rc_print "Removing tmp files in ${dir}/ ..."
22 for file in $(find ${dir} -type f)
23 do
24 [[ $(basename ${file}) = .keep ]] && continue
25 rm -f ${file}
26 done
27 for subdir in $(find ${dir} -mindepth 1 -type d)
28 do
29 [[ -f ${subdir}/.keep ]] && continue
30 rm -r ${subdir}
31 done
32 evaluate_retval
33 done
34
35 rc_print "Creating new /run/utmp ..."
36 touch /run/utmp && chmod 644 /run/utmp
37 evaluate_retval
38
39 rc_print "Creating new /var/log/wtmp ..."
40 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

Properties

Name Value
svn:executable *