From 5a6834585c43296c2207f5f251d3d5c237c7c8d2 Mon Sep 17 00:00:00 2001 From: Sn4il Date: Wed, 6 Mar 2024 10:25:41 +0300 Subject: Update LFS mirror --- lfs-12.1-sysv/scripts/apds06.html | 144 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 lfs-12.1-sysv/scripts/apds06.html (limited to 'lfs-12.1-sysv/scripts/apds06.html') diff --git a/lfs-12.1-sysv/scripts/apds06.html b/lfs-12.1-sysv/scripts/apds06.html new file mode 100644 index 0000000..54dd869 --- /dev/null +++ b/lfs-12.1-sysv/scripts/apds06.html @@ -0,0 +1,144 @@ + + + + + + D.6. /etc/rc.d/init.d/swap + + + + + + + + +

+ D.6. /etc/rc.d/init.d/swap +

+
+
#!/bin/sh
+########################################################################
+# Begin swap
+#
+# Description : Swap Control Script
+#
+# Authors     : Gerard Beekmans - gerard@linuxfromscratch.org
+#               DJ Lucas - dj@linuxfromscratch.org
+# Update      : Bruce Dubbs - bdubbs@linuxfromscratch.org
+#
+# Version     : LFS 7.0
+#
+########################################################################
+
+### BEGIN INIT INFO
+# Provides:            swap
+# Required-Start:      udev
+# Should-Start:        modules
+# Required-Stop:       localnet
+# Should-Stop:         $local_fs
+# Default-Start:       S
+# Default-Stop:        0 6
+# Short-Description:   Activates and deactivates swap partitions.
+# Description:         Activates and deactivates swap partitions defined in
+#                      /etc/fstab.
+# X-LFS-Provided-By:   LFS
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+case "${1}" in
+   start)
+      log_info_msg "Activating all swap files/partitions..."
+      swapon -a
+      evaluate_retval
+      ;;
+
+   stop)
+      log_info_msg "Deactivating all swap files/partitions..."
+      swapoff -a
+      evaluate_retval
+      ;;
+
+   restart)
+      ${0} stop
+      sleep 1
+      ${0} start
+      ;;
+
+   status)
+      log_success_msg "Retrieving swap status."
+      swapon -s
+      ;;
+
+   *)
+      echo "Usage: ${0} {start|stop|restart|status}"
+      exit 1
+      ;;
+esac
+
+exit 0
+
+# End swap
+
+
+ + + -- cgit v1.2.3