diff options
author | davidovski <david@davidovski.xyz> | 2022-03-29 23:36:22 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-03-29 23:36:22 +0100 |
commit | df88860947686a5e6507fc5d60ff33eac1158c6b (patch) | |
tree | d1dc7f2f003b08afb6d45f7170d7a0dd353060d3 /xi/init.d/swap | |
parent | 33d239ecb3d66db2b005afbe68a7029c3f2d2ee0 (diff) |
Diffstat (limited to 'xi/init.d/swap')
-rw-r--r-- | xi/init.d/swap | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/xi/init.d/swap b/xi/init.d/swap new file mode 100644 index 0000000..9747024 --- /dev/null +++ b/xi/init.d/swap @@ -0,0 +1,63 @@ +#!/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: 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) + 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 |