From 9526609ae565b49c9ad8ffacd039d3ce381717f3 Mon Sep 17 00:00:00 2001 From: Steven Mondji-Lerider Date: Mon, 6 Aug 2012 09:54:09 +0000 Subject: [PATCH] Modification du script de configuration pour verifier l'activation des ACL et des Quotas --- debian/alternc.config | 38 ++++++++++++++++++++++++++++++++------ debian/templates | 15 +++++++++++++++ 2 files changed, 47 insertions(+), 6 deletions(-) diff --git a/debian/alternc.config b/debian/alternc.config index 0053a911..b3dda949 100644 --- a/debian/alternc.config +++ b/debian/alternc.config @@ -20,6 +20,8 @@ fi db_input critical alternc/warningaclquota || true + + # default values for local.sh MYSQL_HOST=127.0.0.1 MYSQL_DATABASE=alternc @@ -66,6 +68,36 @@ if [ -r /etc/alternc/my_mail.cnf ]; then fi # mettre les valeurs de local.sh comme "default" pour debconf +db_get alternc/alternc_location +if [ -z "$RET" ] + then +db_set alternc/alternc_location "$ALTERNC_LOC" +fi + +db_get alternc/alternc_location +#checking acl and quota activation, does't work with NFS yet. +location=$RET +mount_point=`df -P $location | tail -1 | /usr/bin/awk '{print $NF}'` +quota_activation=`quotaon -pa |grep '^group.*on$' | /usr/bin/awk '$4 ~ /^\'$mount_point'$/ {print $4}'` +acl_activation=`/bin/mount | awk '$NF ~ /acl/ && $NF !~ /noacl/ && $3 ~ /^\'"$mount_point"'$/ {print $3}'` + +if [ "$mount_point" != "$acl_activation" ] +then + db_input critical alternc/acluninstalled || true + db_go + db_reset alternc/acluninstalled || true + db_fset alternc/acluninstalled "seen" "false" || true + exit 1 +fi + +if [ "$mount_point" != "$quota_activation" ] +then + db_input critical alternc/quotauninstalled || true + db_go + db_reset alternc/puotauninstalled || true + db_fset alternc/quotauninstalled "seen" "false" || true +fi + db_get alternc/hostingname if [ -z "$RET" ] then @@ -162,12 +194,6 @@ if [ -z "$RET" ] db_set alternc/sql/backup_overwrite "$SQLBACKUP_OVERWRITE" fi -db_get alternc/alternc_location -if [ -z "$RET" ] - then -db_set alternc/alternc_location "$ALTERNC_LOC" -fi - db_get alternc/mysql/alternc_mail_user if [ -z "$RET" ] then diff --git a/debian/templates b/debian/templates index 28499010..f32d5fe5 100644 --- a/debian/templates +++ b/debian/templates @@ -22,6 +22,21 @@ _Description: AlternC need ACL and QUOTA activated Also, you need to activate group quota (grpquota) to be able to use disk quota. +Template: alternc/acluninstalled +Type: note +_Description: AlternC need ACL activated + AlternC can't work without ACL activated on his file system. + ACL not activated + . + Also, you need to activate group quota (grpquota) + to be able to use disk quota. + +Template: alternc/quotauninstalled +Type: note +_Description: AlternC QUOTA not activated + The QUOTA assigned to each user will be infinite. + . + Template: alternc/desktopname Type: string _Description: Fully qualified name of the desktop: