From 6e6982c89d9a4d4ca5533135299d55f371d854d4 Mon Sep 17 00:00:00 2001 From: Steven Mondji-Lerider Date: Mon, 25 Feb 2013 10:37:28 +0000 Subject: [PATCH] Changing alternc.config way of checking of acls configuration.. --- debian/alternc.config | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/debian/alternc.config b/debian/alternc.config index 93e76a3d..67c4e33f 100644 --- a/debian/alternc.config +++ b/debian/alternc.config @@ -189,22 +189,22 @@ while [ "$QUEST_STATE" != 0 -a "$QUEST_STATE" != 13 ]; do db_input high alternc/alternc_html fi db_get alternc/alternc_html - LOCATION="$RET" - #checking acl and quota activation, does't work with NFS yet. should now work with lxc + + ALTERNC_HTML="$RET" + #checking acl and quota activation. MOUNT_POINT=$(df -P ${LOCATION%/*} | tail -n 1 | awk '{print $6}') + aclcheckfile="$LOCATION"."test-acl" + touch "$aclcheckfile" + setfacl -m u:root:rwx "$aclcheckfile" 2>/dev/null || ( echo "Error : ACL aren't activated on $ALTERNC_HTML AlternC can't work without it." ; exit 2) - # Get the mount options for the path: (warning, / may have multiple declarations, take the last one only : - MOUNT_OPTS=$(awk '$2=="'$MOUNT_POINT'" { print $4 }' /proc/mounts | tail -1) - - # Check to see if acl is one of the mount points: - ACL="$(echo "$MOUNT_OPTS" | tr "," "\\n" | egrep '^acl|attr2|user_xattr$')" || true - if [ -z "$ACL" ]; then + if [ $? -ne 0 ]; then db_input critical alternc/acluninstalled || true db_go db_reset alternc/acluninstalled || true db_fset alternc/acluninstalled "seen" "false" || true exit 2 fi + quota_activation=$(quotaon -pa 2>/dev/null |grep '^group.*on$' | awk '$4 ~ /^\'$MOUNT_POINT'$/ {print $4}') if [ -z "$quota_activation" -o "$quota_activation" != "$MOUNT_POINT" ]; then