From ff32ae5305d0076ec7b21690f8fc5f6fe840f9aa Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Wed, 27 Feb 2013 16:59:11 +0530 Subject: [PATCH] CLOUDSTACK-1340: During cleanup deluser vagrant, sync after zero-ing the disk Signed-off-by: Rohit Yadav --- tools/appliance/definitions/systemvmtemplate/cleanup.sh | 3 +++ tools/appliance/definitions/systemvmtemplate/zerodisk.sh | 1 + 2 files changed, 4 insertions(+) diff --git a/tools/appliance/definitions/systemvmtemplate/cleanup.sh b/tools/appliance/definitions/systemvmtemplate/cleanup.sh index 6009aad8e78..2dad6129b4c 100644 --- a/tools/appliance/definitions/systemvmtemplate/cleanup.sh +++ b/tools/appliance/definitions/systemvmtemplate/cleanup.sh @@ -17,3 +17,6 @@ rm /lib/udev/rules.d/75-persistent-net-generator.rules echo "Adding a 2 sec delay to the interface up, to make the dhclient happy" echo "pre-up sleep 2" >> /etc/network/interfaces + +# Remove the vagrant user +deluser --group --force -remove-home vagrant diff --git a/tools/appliance/definitions/systemvmtemplate/zerodisk.sh b/tools/appliance/definitions/systemvmtemplate/zerodisk.sh index 9fc9f6f8693..0d105c226d1 100644 --- a/tools/appliance/definitions/systemvmtemplate/zerodisk.sh +++ b/tools/appliance/definitions/systemvmtemplate/zerodisk.sh @@ -3,5 +3,6 @@ rm -f /root/* # Zero out the free space to save space in the final image: dd if=/dev/zero of=/EMPTY bs=1M +sync rm -f /EMPTY