richard: server/kolabd/kolabd/dist_conf suse, 1.84, 1.85 kolabsrv.in, 1.13, 1.14

cvs at kolab.org cvs at kolab.org
Sat Feb 21 22:53:54 CET 2009


Author: richard

Update of /kolabrepository/server/kolabd/kolabd/dist_conf
In directory doto:/tmp/cvs-serv11129/dist_conf

Modified Files:
	suse kolabsrv.in 
Log Message:
dist_conf/kolabsrv.in: added argument checks, source in the file
/etc/kolab/profile.sh if it exists

dist_conf/suse: assigned a value to kolab_quotawarning



Index: suse
===================================================================
RCS file: /kolabrepository/server/kolabd/kolabd/dist_conf/suse,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- suse	15 Feb 2009 18:14:14 -0000	1.84
+++ suse	21 Feb 2009 21:53:51 -0000	1.85
@@ -93,6 +93,7 @@
 kolab_php_module_prefix=kolab/
 kolab_php_smarty_prefix=Smarty
 smarty_compiledir=${phplibdir2}/${kolab_php_module_prefix}admin/templates_c
+kolab_quotawarning=${sysconfdir}/kolab/quotawarning.txt
 
 # Kolab web user interface
 kolab_wui=/kolab

Index: kolabsrv.in
===================================================================
RCS file: /kolabrepository/server/kolabd/kolabd/dist_conf/kolabsrv.in,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- kolabsrv.in	14 Feb 2009 13:30:57 -0000	1.13
+++ kolabsrv.in	21 Feb 2009 21:53:51 -0000	1.14
@@ -32,6 +32,9 @@
 # map distribution specific rc script names
 function getServiceName() {
 	sname=$1
+	# Perhaps better use:
+	# lsb_release -i | cut -d"	" -f2
+	# (be aware of the tab....)
 	if [ -e /etc/SuSE-release ]; then
 		case $sname in
 			openldap) SERVICE="@LDAPD@" ;;
@@ -46,24 +49,80 @@
 
 # variables
 RC=$1
+SERVICE=$2
+PARAM=$3
+
+# Use the service name as defined in the openpkg environment
+# Kolab installations on native distributions, should adap service names
+# with the function getServiceName
+SERVICES="@LDAPD@ saslauthd spamd amavisd apache2 freshclam cyrus postfix"
+SERVICES="$SERVICES clamav kolabd"
 
 case $RC in 
-	rc) ;; # okay
-	*) echo "ERROR: $1 not supported";;
+rc)
+	# okay
+	;;
+*)
+	SERVICES=$(echo $SERVICES | tr -s " " | sed 's, ,|,'g)
+
+	( echo "ERROR: $RC not supported"
+	  echo "Use: @KOLABRC@ rc [all|$SERVICES] [stop|start|restart|status]"
+	) >&2
+
+	exit 1
+	;;
 esac
 
-if [[ "$2" == "all" ]]; then
-	SERVICES="@LDAPD@ saslauthd spamd amavis apache2 freshclam clamd cyrus postfix"
-	SERVICES="$SERVICES kolabd"
-else
-	SERVICES=$2
+if [[ "$SERVICE" != "all" ]]; then
+
+	SERVICE_FOUND=no
+
+	for S in $SERVICES; do
+		if [[ $S == "$SERVICE" ]]; then
+			SERVICE_FOUND=yes
+			SERVICES=$SERVICE
+			break
+		fi
+	done
+
+	if [[ $SERVICE_FOUND == "no" ]]; then
+		( echo "ERROR: unknown service: $SERVICE"
+		  echo "Use: @KOLABRC@ rc [all|$SERVICES] [stop|start|restart|status]"
+		) >&2
+
+		exit 1
+	fi
 fi
 
-PARAM=$3
+[[ -f @sysconfdir@/kolab/profile.sh ]] && . @sysconfdir@/kolab/profile.sh
+
 RCDIR=@kolab_rcdir@
 
 for SERVICE in $SERVICES; do
-	getServiceName $SERVICE
-	check $SERVICE
+	# Only start the virus scanning dependent services in case
+	# virus scannning has been enabled on the kolab web admin interface.
+	# An service is always stopped independent of the virus service	
+	# scanning setting.
+	if [[ "$PARAM" == "start" ]] || [[ "$PARAM" == "restart" ]]; then
+		case $SERVICE in
+		amavisd|clamav|freshclam|spamd)
+			if [[ "$ENABLE_VIRUS_SCAN" == "no" ]]; then
+				RUN_SERVICE=no
+			else
+				RUN_SERVICE=yes
+			fi
+			;;
+		*)
+			RUN_SERVICE=yes
+			;;
+		esac
+	else
+		RUN_SERVICE=yes
+	fi
+
+	[[ $RUN_SERVICE == "yes" ]] && {
+		getServiceName $SERVICE
+		check $SERVICE
+	}
 done
 





More information about the commits mailing list