OSDN Git Service

2d813a38d6e658fa6252b39a58af4815d47925d9
[linuxjf/JF.git] / docs / LFS-BOOK / scripts / apds07.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.7. /etc/rc.d/init.d/swap
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="apds06.html" title=
25           "/etc/rc.d/init.d/udev">前のページ</a>
26           <p>
27             /etc/rc.d/init.d/udev
28           </p>
29         </li>
30         <li class="next">
31           <a accesskey="n" href="apds08.html" title=
32           "/etc/rc.d/init.d/setclock">次のページ</a>
33           <p>
34             /etc/rc.d/init.d/setclock
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="swap" name="swap"></a>D.7. /etc/rc.d/init.d/swap
50       </h1>
51       <pre class="screen">
52 #!/bin/sh
53 ########################################################################
54 # Begin swap
55 #
56 # Description : Swap Control Script
57 #
58 # Authors     : Gerard Beekmans - gerard@linuxfromscratch.org
59 #               DJ Lucas - dj@linuxfromscratch.org
60 # Update      : Bruce Dubbs - bdubbs@linuxfromscratch.org
61 #
62 # Version     : LFS 7.0
63 #
64 ########################################################################
65
66 ### BEGIN INIT INFO
67 # Provides:            swap
68 # Required-Start:      udev
69 # Should-Start:        modules
70 # Required-Stop:       localnet
71 # Should-Stop:
72 # Default-Start:       S
73 # Default-Stop:        0 6
74 # Short-Description:   Mounts and unmounts swap partitions.
75 # Description:         Mounts and unmounts swap partitions defined in
76 #                      /etc/fstab.
77 # X-LFS-Provided-By:   LFS
78 ### END INIT INFO
79
80 . /lib/lsb/init-functions
81
82 case "${1}" in
83    start)
84       log_info_msg "Activating all swap files/partitions..."
85       swapon -a
86       evaluate_retval
87       ;;
88
89    stop)
90       log_info_msg "Deactivating all swap files/partitions..."
91       swapoff -a
92       evaluate_retval
93       ;;
94
95    restart)
96       ${0} stop
97       sleep 1
98       ${0} start
99       ;;
100
101    status)
102       log_success_msg "Retrieving swap status." 
103       swapon -s
104       ;;
105
106    *)
107       echo "Usage: ${0} {start|stop|restart|status}"
108       exit 1
109       ;;
110 esac
111
112 exit 0
113
114 # End swap
115 </pre>
116     </div>
117     <div class="navfooter">
118       <ul>
119         <li class="prev">
120           <a accesskey="p" href="apds06.html" title=
121           "/etc/rc.d/init.d/udev">前のページ</a>
122           <p>
123             /etc/rc.d/init.d/udev
124           </p>
125         </li>
126         <li class="next">
127           <a accesskey="n" href="apds08.html" title=
128           "/etc/rc.d/init.d/setclock">次のページ</a>
129           <p>
130             /etc/rc.d/init.d/setclock
131           </p>
132         </li>
133         <li class="up">
134           <a accesskey="u" href="scripts.html" title=
135           "付録 D. ブートスクリプトと sysconfig スクリプト version-20120901">上に戻る</a>
136         </li>
137         <li class="home">
138           <a accesskey="h" href="../index.html" title=
139           "Linux From Scratch - Version 7.2">ホーム</a>
140         </li>
141       </ul>
142     </div>
143   </body>
144 </html>