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-7.2">
15 <div class="navheader">
17 Linux From Scratch - Version 7.2
20 付録 D. ブートスクリプトと sysconfig スクリプト version-20120901
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-20120901">上に戻る</a>
42 <a accesskey="h" href="../index.html" title=
43 "Linux From Scratch - Version 7.2">ホーム</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 ########################################################################
56 # Description : Clean file system
58 # Authors : Gerard Beekmans - gerard@linuxfromscratch.org
59 # DJ Lucas - dj@linuxfromscratch.org
60 # Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
64 ########################################################################
68 # Required-Start: $local_fs
74 # Short-Description: Cleans temporary directories early in the boot process.
75 # Description: Cleans temporary directories /var/run, /var/lock, and
76 # optionally, /tmp. cleanfs also creates /var/run/utmp
77 # and any files defined in /etc/sysconfig/createfiles.
78 # X-LFS-Provided-By: LFS
81 . /lib/lsb/init-functions
83 # Function to create files/directory on boot.
86 # Input to file descriptor 9 and output to stdin (redirection)
87 exec 9>&0 < /etc/sysconfig/createfiles
89 while read name type perm usr grp dtype maj min junk
91 # Ignore comments and blank lines.
96 # Ignore existing files.
97 if [ ! -e "${name}" ]; then
98 # Create stuff based on its type.
109 mknod "${name}" c ${maj} ${min}
112 mknod "${name}" b ${maj} ${min}
118 log_warning_msg "\nUnknown device type: ${dtype}"
123 log_warning_msg "\nUnknown type: ${type}"
128 # Set up the permissions, too.
129 chown ${usr}:${grp} "${name}"
130 chmod ${perm} "${name}"
134 # Close file descriptor 9 (end redirection)
135 exec 0>&9 9>&-
141 log_info_msg "Cleaning file systems:"
143 if [ "${SKIPTMPCLEAN}" = "" ]; then
144 log_info_msg2 " /tmp"
146 find . -xdev -mindepth 1 ! -name lost+found -delete || failed=1
151 if grep -q '^utmp:' /etc/group ; then
152 chmod 664 /var/run/utmp
153 chgrp utmp /var/run/utmp
159 if egrep -qv '^(#|$)' /etc/sysconfig/createfiles 2>/dev/null; then
160 log_info_msg "Creating files and directories... "
161 create_files # Always returns 0
168 echo "Usage: ${0} {start}"
176 <div class="navfooter">
179 <a accesskey="p" href="apds11.html" title=
180 "/etc/rc.d/init.d/udev_retry">前のページ</a>
182 /etc/rc.d/init.d/udev_retry
186 <a accesskey="n" href="apds13.html" title=
187 "/etc/rc.d/init.d/console">次のページ</a>
189 /etc/rc.d/init.d/console
193 <a accesskey="u" href="scripts.html" title=
194 "付録 D. ブートスクリプトと sysconfig スクリプト version-20120901">上に戻る</a>
197 <a accesskey="h" href="../index.html" title=
198 "Linux From Scratch - Version 7.2">ホーム</a>