From: Peter Palfrader Date: Wed, 20 Jun 2012 07:31:39 +0000 (+0200) Subject: Create swapfiles, 2 X-Git-Url: https://git.donarmstrong.com/?p=dsa-puppet.git;a=commitdiff_plain;h=a7b6008d7ac034afe219b4efe8ac069d331c25ad Create swapfiles, 2 --- diff --git a/modules/ganeti2/templates/instance-debootstrap/hooks/40-dsa-setup-swapfile.erb b/modules/ganeti2/templates/instance-debootstrap/hooks/40-dsa-setup-swapfile.erb new file mode 100755 index 00000000..4237ff2e --- /dev/null +++ b/modules/ganeti2/templates/instance-debootstrap/hooks/40-dsa-setup-swapfile.erb @@ -0,0 +1,21 @@ +#!/bin/bash + +. common.sh + +if [ -z "$TARGET" -o ! -d "$TARGET" ]; then + echo "Missing target directory" + exit 1 +fi + +dd if=/dev/zero of="$TARGET/swapfile" bs=1024k count=512 +chmod 400 "$TARGET/swapfile" +mkswap "$TARGET/swapfile" + +cat >> "$TARGET/etc/fstab" <