source: lsb-bootscripts/etc/init.d/swap@ 8476b9e1

7.1
Last change on this file since 8476b9e1 was f3f65e73, checked in by DJ Lucas <dj@…>, 13 years ago

Added stop_on_error parameter to rc.site and cleaned up Begin and End lines.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@9552 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[1c48007]1#!/bin/sh
[f3f65e73]2# Begin $RC_BASE/init.d/swap
[1c48007]3
4### BEGIN INIT INFO
5# Provides: swap
[d03909f]6# Required-Start: udev
[67de919]7# Should-Start: modules
[614a14e]8# Required-Stop: localnet
[010d108]9# Should-Stop:
10# Default-Start: S
11# Default-Stop: 0 6
[1c48007]12# Short-Description: Mounts and unmounts swap partitions.
13# Description: Mounts and unmounts swap partitions defined in
14# /etc/fstab.
15# X-LFS-Provided-By: LFS
16### END INIT INFO
17
18. /lib/lsb/init-functions
19
20case "${1}" in
21 start)
22 message="Activating all swap files/partitions..."
23 swapon -a
24 evaluate_retval standard
25 ;;
26
27 stop)
28 message="Deactivating all swap files/partitions..."
29 swapoff -a
30 evaluate_retval standard
31 ;;
32
33 restart)
34 swapoff -a
35 error_level="${?}"
36 sleep 1
37 swapon -a
38 error_level="$(( ${error_level} + ${?} ))"
39 (exit "${error_level}")
40 evaluate_retval restart
41 ;;
42
43 status)
44 log_success_msg "Retrieving swap status..."
45 echo
46 swapon -s
47 ;;
48
49 *)
50 echo "Usage: ${0} {start|stop|restart|status}"
51 exit 1
52 ;;
53esac
54
[f3f65e73]55# End $RC_BASE/init.d/swap
Note: See TracBrowser for help on using the repository browser.