Changing alternc.config way of checking of acls configuration..
This commit is contained in:
parent
4cb08b34d7
commit
6e6982c89d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue