source: bootscripts/lfs/init.d/swap@ 4d04dc7

11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 bdubbs/gcc13 multilib renodr/libudev-from-systemd trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 4d04dc7 was 4d04dc7, checked in by Xi Ruoyao <xry111@…>, 19 months ago

init.d/swap: you can't mount a swap partition

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[1c48007]1#!/bin/sh
2########################################################################
[0cda898]3# Begin swap
[1c48007]4#
5# Description : Swap Control Script
6#
7# Authors : Gerard Beekmans - gerard@linuxfromscratch.org
[f874424]8# DJ Lucas - dj@linuxfromscratch.org
[0cda898]9# Update : Bruce Dubbs - bdubbs@linuxfromscratch.org
[1c48007]10#
[0cda898]11# Version : LFS 7.0
[1c48007]12#
13########################################################################
14
[0cda898]15### BEGIN INIT INFO
16# Provides: swap
17# Required-Start: udev
18# Should-Start: modules
[3c784d8]19# Required-Stop: localnet
20# Should-Stop: $local_fs
[0cda898]21# Default-Start: S
22# Default-Stop: 0 6
[4d04dc7]23# Short-Description: Activates and deactivates swap partitions.
24# Description: Activates and deactivates swap partitions defined in
[0cda898]25# /etc/fstab.
26# X-LFS-Provided-By: LFS
27### END INIT INFO
28
[f874424]29. /lib/lsb/init-functions
[1c48007]30
31case "${1}" in
[0cda898]32 start)
[f874424]33 log_info_msg "Activating all swap files/partitions..."
[0cda898]34 swapon -a
35 evaluate_retval
36 ;;
37
38 stop)
[f874424]39 log_info_msg "Deactivating all swap files/partitions..."
[0cda898]40 swapoff -a
41 evaluate_retval
42 ;;
43
44 restart)
45 ${0} stop
46 sleep 1
47 ${0} start
48 ;;
49
50 status)
[a44ae577]51 log_success_msg "Retrieving swap status."
[0cda898]52 swapon -s
53 ;;
54
55 *)
56 echo "Usage: ${0} {start|stop|restart|status}"
57 exit 1
58 ;;
[1c48007]59esac
60
[f874424]61exit 0
62
[0cda898]63# End swap
Note: See TracBrowser for help on using the repository browser.