aboutsummaryrefslogtreecommitdiffstats
path: root/systemd/fedora-swapon
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2010-10-15 16:25:31 -0400
committerBill Nottingham <notting@redhat.com>2010-10-15 16:25:31 -0400
commit59b2f505ea603ef65823615711b5adfa87795f41 (patch)
treed5b42a97c7c6e964d920c51f39d890313b997b09 /systemd/fedora-swapon
parent675389f11ffaab590e9dedabc821e33745e3eb5c (diff)
downloadinitscripts-59b2f505ea603ef65823615711b5adfa87795f41.tar
initscripts-59b2f505ea603ef65823615711b5adfa87795f41.tar.gz
initscripts-59b2f505ea603ef65823615711b5adfa87795f41.tar.bz2
initscripts-59b2f505ea603ef65823615711b5adfa87795f41.tar.xz
initscripts-59b2f505ea603ef65823615711b5adfa87795f41.zip
Add split-out bits of rc.sysinit and associated service files. Remove sysinit.service. Based on work by Harald Hoyer (<harald@redhat.com>)
sysinit-hack/unhack will be removed once the net hotplug stuff is fixed to not require this.
Diffstat (limited to 'systemd/fedora-swapon')
-rwxr-xr-xsystemd/fedora-swapon20
1 files changed, 20 insertions, 0 deletions
diff --git a/systemd/fedora-swapon b/systemd/fedora-swapon
new file mode 100755
index 00000000..98c5b273
--- /dev/null
+++ b/systemd/fedora-swapon
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+# Start up swap (partitions and files)
+#
+
+. /etc/init.d/functions
+
+update_boot_stage RCswap
+action $"Enabling /etc/fstab swaps: " swapon -a -e
+if [ "$AUTOSWAP" = "yes" ]; then
+ curswap=$(awk '/^\/dev/ { print $1 }' /proc/swaps | while read x; do get_numeric_dev dec $x ; echo -n " "; done)
+ swappartitions=$(blkid -t TYPE=swap -o device)
+ if [ x"$swappartitions" != x ]; then
+ for partition in $swappartitions ; do
+ [ ! -e $partition ] && continue
+ majmin=$(get_numeric_dev dec $partition)
+ echo $curswap | grep -qw "$majmin" || action $"Enabling local swap partitions: " swapon $partition
+ done
+ fi
+fi