From 8dd2535c662488798f45432dd28f3dd1309a40ad Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 5 Nov 2014 14:16:14 +0530 Subject: [PATCH] Fixed Swap file permission --- src/lib/ee_lib_swap.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/ee_lib_swap.sh b/src/lib/ee_lib_swap.sh index f375afac..1cb20de7 100644 --- a/src/lib/ee_lib_swap.sh +++ b/src/lib/ee_lib_swap.sh @@ -17,6 +17,11 @@ function ee_lib_swap() mkswap /ee-swapfile &>> $EE_COMMAND_LOG \ || ee_lib_error "Unable to create swapfile, exit status = " $? + # Change Permission for swapfile + chown root:root /ee-swapfile && + chmod 0600 /ee-swapfile \ + || ee_lib_error "Unable to change Swapfile permission, exit status = " $? + # On the Swap swapon /ee-swapfile &>> $EE_COMMAND_LOG \ || ee_lib_error "Unable to on Swap, exit status = " $? @@ -24,11 +29,6 @@ function ee_lib_swap() # Add entry into /etc/fstab echo "/ee-swapfile none swap sw 0 0" >> /etc/fstab \ || ee_lib_error "Unable to add entry into /etc/fstab, exit status = " $? - - # Change Permission for swapfile - chown root:root /ee-swapfile && - chmod 0600 /ee-swapfile \ - || ee_lib_error "Unable to change Swapfile permission, exit status = " $? fi fi }