swap creation and removal

This commit is contained in:
Mark Korondi 2016-09-21 16:19:01 +02:00
parent ebb89b3cef
commit d9912aeabb
3 changed files with 23 additions and 1 deletions

17
files/etc/rc.local Executable file
View File

@ -0,0 +1,17 @@
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
dd if=/dev/zero of=/home/vagrant/swap.img bs=1M count=2048
mkswap /home/vagrant/swap.img
swapon /home/vagrant/swap.img
exit 0

4
files/etc/rc6.d/K99remove-swap Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
swapoff -a
rm -rf /home/vagrant/swap.img

View File

@ -31,5 +31,6 @@ sudo apt-get clean
# Enable shared folder access
sudo adduser vagrant vboxsf
# Enable autologin
# Copy global configs (/etc)
# (autologin, swap creation and deletion, etc.)
sudo cp -ar /vagrant/files/etc /