richard: server/kolabd/kolabd/dist_conf kolabsrv.in,1.20,1.21
cvs at kolab.org
cvs at kolab.org
Mon Nov 23 22:55:23 CET 2009
Author: richard
Update of /kolabrepository/server/kolabd/kolabd/dist_conf
In directory doto:/tmp/cvs-serv26859/dist_conf
Modified Files:
kolabsrv.in
Log Message:
- remove spamd as service, for more info refer to
https://issues.kolab.org/issue3953
- services can be listed in execution and alphabetical order
- changed the method to determine a distribution
Index: kolabsrv.in
===================================================================
RCS file: /kolabrepository/server/kolabd/kolabd/dist_conf/kolabsrv.in,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- kolabsrv.in 21 Nov 2009 09:50:07 -0000 1.20
+++ kolabsrv.in 23 Nov 2009 21:55:21 -0000 1.21
@@ -36,7 +36,8 @@
sname=$1
# Perhaps better use:
# lsb_release -i | cut -f2
- if [ -e /etc/SuSE-release ]; then
+ case $system in
+ opensuse)
case $sname in
apache) SERVICE="apache2" ;;
openldap) SERVICE="@LDAPD@" ;;
@@ -46,7 +47,8 @@
clamav) SERVICE="clamd" ;;
*) SERVICE=$sname
esac
- elif [ -e /etc/debian_version ]; then
+ ;;
+ debian)
case $sname in
apache) SERVICE="apache2" ;;
openldap) SERVICE="@LDAPD@" ;;
@@ -58,9 +60,29 @@
freshclam) SERVICE="clamav-freshclam" ;;
*) SERVICE=$sname
esac
- fi
+ ;;
+ esac
}
+# Copied from the script /etc/init.d/vboxadd from Virtualbox
+# That script has more nice code, for e.g. displaying the result of
+# executed commands.
+if [ -f /etc/arch-release ]; then
+ system=arch
+elif [ -f /etc/redhat-release ]; then
+ system=redhat
+elif [ -f /etc/SuSE-release ]; then
+ system=opensuse
+elif [ -f /etc/gentoo-release ]; then
+ system=gentoo
+elif [ -e /etc/debian_version ]; then
+ system=debian
+elif [ -f /etc/lfs-release -a -d /etc/rc.d/init.d ]; then
+ system=lfs
+else
+ system=other
+fi
+
[[ -f /etc/kolab/profile.sh ]] && . /etc/kolab/profile.sh
# variables
@@ -71,20 +93,33 @@
# Use the service name as defined in the openpkg environment
# Kolab installations on native distributions, should adapt service names
# with the function getServiceName
-SERVICES="openldap sasl spamd amavisd apache freshclam imapd postfix"
+#
+# In earlier days, spamd was part of the services as well. But as
+# spamassassin is used as library for amavisd, it is not needed to run it
+# as a seperate service. More information about this topic can be found
+# at https://issues.kolab.org/issue3953
+SERVICES="openldap sasl amavisd apache freshclam imapd postfix"
SERVICES="$SERVICES clamav kolabd"
case $RC in
rc)
# okay
;;
-list)
+*list)
# Provide an alphanumerical list of services.
for S in $SERVICES; do
getServiceName $S
- echo $SERVICE
- done | tr " " "\n" | sort | tr "\n" " "
- echo
+ DIST_SERVICES="$DIST_SERVICES $SERVICE"
+ done
+ case $RC in
+ alphalist)
+ echo $DIST_SERVICES | tr " " "\n" | sort | tr "\n" " "
+ echo
+ ;;
+ *)
+ echo $DIST_SERVICES
+ ;;
+ esac
exit
;;
status)
@@ -125,8 +160,12 @@
( [[ -n "$RC" ]] && echo "ERROR: $RC not supported"
echo "Use: $PRGNAME rc [all|$SERVICES] [stop|start|restart|status]"
echo
- echo "Obtain a list of all kolab related processes:"
+ echo "Obtain a list of all kolab related processes;"
+ echo "- in execution order:"
echo " $PRGNAME list"
+ echo
+ echo "- in alphabetical order:"
+ echo " $PRGNAME alphalist"
echo
echo "Display the state of the all kolab related processes:"
echo " $PRGNAME status"
More information about the commits
mailing list