summaryrefslogtreecommitdiffstats
path: root/src/etc
diff options
context:
space:
mode:
authorLuiz Souza <luiz@netgate.com>2017-09-19 16:37:26 -0500
committerLuiz Souza <luiz@netgate.com>2017-09-19 16:38:46 -0500
commit72d2dbdf175a40ff8bd903854407ce640e350bfe (patch)
tree3fcf7653c06adce241d10a5972475b81ee460088 /src/etc
parent7e0b401db2235969fd53cab4bef3078a02eea14a (diff)
downloadpfsense-72d2dbdf175a40ff8bd903854407ce640e350bfe.zip
pfsense-72d2dbdf175a40ff8bd903854407ce640e350bfe.tar.gz
Only run swapon and rc.savecore when the SWAPDEVICE is valid.
(cherry picked from commit d988e0bbf991e28c611b194e9e6ccd99f818209b)
Diffstat (limited to 'src/etc')
-rwxr-xr-xsrc/etc/pfSense-rc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/etc/pfSense-rc b/src/etc/pfSense-rc
index d5eca8a..09683ae 100755
--- a/src/etc/pfSense-rc
+++ b/src/etc/pfSense-rc
@@ -224,8 +224,10 @@ echo
/sbin/conscontrol mute off >/dev/null
SWAPDEVICE=`/bin/cat /etc/fstab | /usr/bin/grep swap | /usr/bin/cut -f1`
-/sbin/swapon -a 2>/dev/null >/dev/null
-/etc/rc.savecore
+if [ -n "${SWAPDEVICE}" ]; then
+ /sbin/swapon -a 2>/dev/null >/dev/null
+ /etc/rc.savecore
+fi
# make some directories in /var
/bin/mkdir -p $varrunpath /var/log /var/etc /var/db/entropy /var/db/rrd /var/at/jobs/ /var/empty /var/log/nginx 2>/dev/null
OpenPOWER on IntegriCloud