OSDN Git Service

Update to lfsbook 7.2.ja
[linuxjf/JF.git] / docs / LFS-BOOK / scripts / apds04.html
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">
4   <head>
5     <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
6     <title>
7       D.4. /etc/rc.d/init.d/mountvirtfs
8     </title>
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" />
13   </head>
14   <body class="lfs" id="lfs-7.2">
15     <div class="navheader">
16       <h4>
17         Linux From Scratch - Version 7.2
18       </h4>
19       <h3>
20         付録 D. ブートスクリプトと sysconfig スクリプト version-20120901
21       </h3>
22       <ul>
23         <li class="prev">
24           <a accesskey="p" href="apds03.html" title=
25           "/etc/rc.d/init.d/functions">前のページ</a>
26           <p>
27             /etc/rc.d/init.d/functions
28           </p>
29         </li>
30         <li class="next">
31           <a accesskey="n" href="apds05.html" title=
32           "/etc/rc.d/init.d/modules">次のページ</a>
33           <p>
34             /etc/rc.d/init.d/modules
35           </p>
36         </li>
37         <li class="up">
38           <a accesskey="u" href="scripts.html" title=
39           "付録 D. ブートスクリプトと sysconfig スクリプト version-20120901">上に戻る</a>
40         </li>
41         <li class="home">
42           <a accesskey="h" href="../index.html" title=
43           "Linux From Scratch - Version 7.2">ホーム</a>
44         </li>
45       </ul>
46     </div>
47     <div class="wrap" lang="ja" xml:lang="ja">
48       <h1 class="sect1">
49         <a id="mountvirtfs" name="mountvirtfs"></a>D.4.
50         /etc/rc.d/init.d/mountvirtfs
51       </h1>
52       <pre class="screen">
53 #!/bin/sh
54 ########################################################################
55 # Begin mountvirtfs
56 #
57 # Description : Mount proc, sysfs, and run
58 #
59 # Authors     : Gerard Beekmans - gerard@linuxfromscratch.org
60 #               DJ Lucas - dj@linuxfromscratch.org
61 # Update      : Bruce Dubbs - bdubbs@linuxfromscratch.org
62 #
63 # Version     : LFS 7.0
64 #
65 ########################################################################
66
67 ### BEGIN INIT INFO
68 # Provides:            mountvirtfs
69 # Required-Start:
70 # Should-Start:
71 # Required-Stop:
72 # Should-Stop:
73 # Default-Start:       S
74 # Default-Stop:
75 # Short-Description:   Mounts /sys and /proc virtual (kernel) filesystems.
76 #                      Mounts /run (tmpfs) and /dev (devtmpfs).
77 # Description:         Mounts /sys and /proc virtual (kernel) filesystems.
78 #                      Mounts /run (tmpfs) and /dev (devtmpfs).
79 # X-LFS-Provided-By:   LFS
80 ### END INIT INFO
81
82 . /lib/lsb/init-functions
83
84 case "${1}" in
85    start)
86       # Make sure /run/var is available before logging any messages
87       if ! mountpoint /run &gt;/dev/null; then
88          mount -n /run || failed=1
89       fi
90
91       mkdir -p /run/var /run/lock /run/shm
92       chmod 1777 /run/shm
93
94       log_info_msg "Mounting virtual file systems: ${INFO}/run" 
95
96       if ! mountpoint /proc &gt;/dev/null; then
97          log_info_msg2 " ${INFO}/proc"
98          mount -n -o nosuid,noexec,nodev /proc || failed=1
99       fi
100
101       if ! mountpoint /sys &gt;/dev/null; then
102          log_info_msg2 " ${INFO}/sys" 
103          mount -n -o nosuid,noexec,nodev /sys || failed=1
104       fi
105
106       if ! mountpoint /dev &gt;/dev/null; then
107          log_info_msg2 " ${INFO}/dev" 
108          mount -n -o mode=0755,nosuid /dev  || failed=1
109       fi
110
111       # Copy devices that Udev &gt;= 155 doesn't handle to /dev
112       cp -a /lib/udev/devices/* /dev
113
114       ln -sfn /run/shm /dev/shm
115       
116       (exit ${failed})
117       evaluate_retval
118       exit $failed
119       ;;
120
121    *)
122       echo "Usage: ${0} {start}"
123       exit 1
124       ;;
125 esac
126
127 # End mountvirtfs
128 </pre>
129     </div>
130     <div class="navfooter">
131       <ul>
132         <li class="prev">
133           <a accesskey="p" href="apds03.html" title=
134           "/etc/rc.d/init.d/functions">前のページ</a>
135           <p>
136             /etc/rc.d/init.d/functions
137           </p>
138         </li>
139         <li class="next">
140           <a accesskey="n" href="apds05.html" title=
141           "/etc/rc.d/init.d/modules">次のページ</a>
142           <p>
143             /etc/rc.d/init.d/modules
144           </p>
145         </li>
146         <li class="up">
147           <a accesskey="u" href="scripts.html" title=
148           "付録 D. ブートスクリプトと sysconfig スクリプト version-20120901">上に戻る</a>
149         </li>
150         <li class="home">
151           <a accesskey="h" href="../index.html" title=
152           "Linux From Scratch - Version 7.2">ホーム</a>
153         </li>
154       </ul>
155     </div>
156   </body>
157 </html>