<link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
"text/css" media="print" />
</head>
- <body class="lfs" id="lfs-6.8">
+ <body class="lfs" id="lfs-7.2">
<div class="navheader">
<h4>
- Linux From Scratch - Version 6.8
+ Linux From Scratch - Version 7.2
</h4>
<h3>
- 付録 D. ブートスクリプトと sysconfig スクリプト version-20100627
+ 付録 D. ブートスクリプトと sysconfig スクリプト version-20120901
</h3>
<ul>
<li class="prev">
</li>
<li class="up">
<a accesskey="u" href="scripts.html" title=
- "付録 D. ブートスクリプトと sysconfig スクリプト version-20100627">上に戻る</a>
+ "付録 D. ブートスクリプトと sysconfig スクリプト version-20120901">上に戻る</a>
</li>
<li class="home">
<a accesskey="h" href="../index.html" title=
- "Linux From Scratch - Version 6.8">ホーム</a>
+ "Linux From Scratch - Version 7.2">ホーム</a>
</li>
</ul>
</div>
<pre class="screen">
#!/bin/sh
########################################################################
-# Begin $rc_base/init.d/swap
+# Begin swap
#
# Description : Swap Control Script
#
# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
+# DJ Lucas - dj@linuxfromscratch.org
+# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
#
-# Version : 00.00
-#
-# Notes :
+# Version : LFS 7.0
#
########################################################################
-. /etc/sysconfig/rc
-. ${rc_functions}
+### BEGIN INIT INFO
+# Provides: swap
+# Required-Start: udev
+# Should-Start: modules
+# Required-Stop: localnet
+# Should-Stop:
+# Default-Start: S
+# Default-Stop: 0 6
+# Short-Description: Mounts and unmounts swap partitions.
+# Description: Mounts and unmounts swap partitions defined in
+# /etc/fstab.
+# X-LFS-Provided-By: LFS
+### END INIT INFO
+
+. /lib/lsb/init-functions
case "${1}" in
- start)
- boot_mesg "Activating all swap files/partitions..."
- swapon -a
- evaluate_retval
- ;;
+ start)
+ log_info_msg "Activating all swap files/partitions..."
+ swapon -a
+ evaluate_retval
+ ;;
- stop)
- boot_mesg "Deactivating all swap files/partitions..."
- swapoff -a
- evaluate_retval
- ;;
+ stop)
+ log_info_msg "Deactivating all swap files/partitions..."
+ swapoff -a
+ evaluate_retval
+ ;;
- restart)
- ${0} stop
- sleep 1
- ${0} start
- ;;
+ restart)
+ ${0} stop
+ sleep 1
+ ${0} start
+ ;;
- status)
- boot_mesg "Retrieving swap status." ${INFO}
- echo_ok
- echo
- swapon -s
- ;;
+ status)
+ log_success_msg "Retrieving swap status."
+ swapon -s
+ ;;
- *)
- echo "Usage: ${0} {start|stop|restart|status}"
- exit 1
- ;;
+ *)
+ echo "Usage: ${0} {start|stop|restart|status}"
+ exit 1
+ ;;
esac
-# End $rc_base/init.d/swap
+exit 0
+
+# End swap
</pre>
</div>
<div class="navfooter">
</li>
<li class="up">
<a accesskey="u" href="scripts.html" title=
- "付録 D. ブートスクリプトと sysconfig スクリプト version-20100627">上に戻る</a>
+ "付録 D. ブートスクリプトと sysconfig スクリプト version-20120901">上に戻る</a>
</li>
<li class="home">
<a accesskey="h" href="../index.html" title=
- "Linux From Scratch - Version 6.8">ホーム</a>
+ "Linux From Scratch - Version 7.2">ホーム</a>
</li>
</ul>
</div>