OSDN Git Service

700e332d00b8525ce0d82dd0cbcf8fe4bf117f35
[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-6.8">
15     <div class="navheader">
16       <h4>
17         Linux From Scratch - Version 6.8
18       </h4>
19       <h3>
20         付録 D. ブートスクリプトと sysconfig スクリプト version-20100627
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-20100627">上に戻る</a>
40         </li>
41         <li class="home">
42           <a accesskey="h" href="../index.html" title=
43           "Linux From Scratch - Version 6.8">ホーム</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 $rc_base/init.d/swap
55 #
56 # Description : Swap Control Script
57 #
58 # Authors     : Gerard Beekmans - gerard@linuxfromscratch.org
59 #
60 # Version     : 00.00
61 #
62 # Notes       :
63 #
64 ########################################################################
65
66 . /etc/sysconfig/rc
67 . ${rc_functions}
68
69 case "${1}" in
70     start)
71         boot_mesg "Activating all swap files/partitions..."
72         swapon -a
73         evaluate_retval
74         ;;
75
76     stop)
77         boot_mesg "Deactivating all swap files/partitions..."
78         swapoff -a
79         evaluate_retval
80         ;;
81
82     restart)
83         ${0} stop
84         sleep 1
85         ${0} start
86         ;;
87
88     status)
89         boot_mesg "Retrieving swap status." ${INFO}
90         echo_ok
91         echo
92         swapon -s
93         ;;
94
95     *)
96         echo "Usage: ${0} {start|stop|restart|status}"
97         exit 1
98         ;;
99 esac
100
101 # End $rc_base/init.d/swap
102 </pre>
103     </div>
104     <div class="navfooter">
105       <ul>
106         <li class="prev">
107           <a accesskey="p" href="apds06.html" title=
108           "/etc/rc.d/init.d/udev">前のページ</a>
109           <p>
110             /etc/rc.d/init.d/udev
111           </p>
112         </li>
113         <li class="next">
114           <a accesskey="n" href="apds08.html" title=
115           "/etc/rc.d/init.d/setclock">次のページ</a>
116           <p>
117             /etc/rc.d/init.d/setclock
118           </p>
119         </li>
120         <li class="up">
121           <a accesskey="u" href="scripts.html" title=
122           "付録 D. ブートスクリプトと sysconfig スクリプト version-20100627">上に戻る</a>
123         </li>
124         <li class="home">
125           <a accesskey="h" href="../index.html" title=
126           "Linux From Scratch - Version 6.8">ホーム</a>
127         </li>
128       </ul>
129     </div>
130   </body>
131 </html>