1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
5 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
7 D.12. /etc/rc.d/init.d/cleanfs
9 <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />
10 <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
11 <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
12 "text/css" media="print" />
14 <body class="lfs" id="lfs-6.8">
15 <div class="navheader">
17 Linux From Scratch - Version 6.8
20 付録 D. ブートスクリプトと sysconfig スクリプト version-20100627
24 <a accesskey="p" href="apds11.html" title=
25 "/etc/rc.d/init.d/udev_retry">前のページ</a>
27 /etc/rc.d/init.d/udev_retry
31 <a accesskey="n" href="apds13.html" title=
32 "/etc/rc.d/init.d/console">次のページ</a>
34 /etc/rc.d/init.d/console
38 <a accesskey="u" href="scripts.html" title=
39 "付録 D. ブートスクリプトと sysconfig スクリプト version-20100627">上に戻る</a>
42 <a accesskey="h" href="../index.html" title=
43 "Linux From Scratch - Version 6.8">ホーム</a>
47 <div class="wrap" lang="ja" xml:lang="ja">
49 <a id="cleanfs" name="cleanfs"></a>D.12. /etc/rc.d/init.d/cleanfs
53 ########################################################################
54 # Begin $rc_base/init.d/cleanfs
56 # Description : Clean file system
58 # Authors : Gerard Beekmans - gerard@linuxfromscratch.org
64 ########################################################################
69 # Function to create files/directory on boot.
71 # Read in the configuration file.
72 exec 9>&0 < /etc/sysconfig/createfiles
73 while read name type perm usr grp dtype maj min junk
76 # Ignore comments and blank lines.
81 # Ignore existing files.
82 if [ ! -e "${name}" ]; then
83 # Create stuff based on its type.
94 mknod "${name}" c ${maj} ${min}
97 mknod "${name}" b ${maj} ${min}
103 boot_mesg -n "\nUnknown device type: ${dtype}" ${WARNING}
104 boot_mesg "" ${NORMAL}
109 boot_mesg -n "\nUnknown type: ${type}" ${WARNING}
110 boot_mesg "" ${NORMAL}
115 # Set up the permissions, too.
116 chown ${usr}:${grp} "${name}"
117 chmod ${perm} "${name}"
120 exec 0>&9 9>&-
125 boot_mesg -n "Cleaning file systems:" ${INFO}
127 boot_mesg -n " /tmp" ${NORMAL}
129 find . -xdev -mindepth 1 ! -name lost+found \
132 boot_mesg -n " /var/lock" ${NORMAL}
133 cd /var/lock &&
134 find . -type f -exec rm -f {} \; || failed=1
136 boot_mesg " /var/run" ${NORMAL}
137 cd /var/run &&
138 find . ! -type d ! -name utmp \
139 -exec rm -f {} \; || failed=1
141 if grep -q '^utmp:' /etc/group ; then
142 chmod 664 /var/run/utmp
143 chgrp utmp /var/run/utmp
149 if egrep -qv '^(#|$)' /etc/sysconfig/createfiles 2>/dev/null; then
150 boot_mesg "Creating files and directories..."
156 echo "Usage: ${0} {start}"
161 # End $rc_base/init.d/cleanfs
164 <div class="navfooter">
167 <a accesskey="p" href="apds11.html" title=
168 "/etc/rc.d/init.d/udev_retry">前のページ</a>
170 /etc/rc.d/init.d/udev_retry
174 <a accesskey="n" href="apds13.html" title=
175 "/etc/rc.d/init.d/console">次のページ</a>
177 /etc/rc.d/init.d/console
181 <a accesskey="u" href="scripts.html" title=
182 "付録 D. ブートスクリプトと sysconfig スクリプト version-20100627">上に戻る</a>
185 <a accesskey="h" href="../index.html" title=
186 "Linux From Scratch - Version 6.8">ホーム</a>