summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Cafarelli <voyageur@gentoo.org>2010-01-12 15:00:03 +0000
committerBernard Cafarelli <voyageur@gentoo.org>2010-01-12 15:00:03 +0000
commitdb5f82845b98deb6670ab7ca695e4c1fa51de5fe (patch)
treef773f5f217ba8bd72bb1c1a9df0262fd7941b3bb /gnustep-apps/sogo/files/sogod.initd
parentUpdate sope from bug #295634 (diff)
downloadgnustep-db5f82845b98deb6670ab7ca695e4c1fa51de5fe.tar.gz
gnustep-db5f82845b98deb6670ab7ca695e4c1fa51de5fe.tar.bz2
gnustep-db5f82845b98deb6670ab7ca695e4c1fa51de5fe.zip
Update sogo from bug #295636, fix metadata
svn path=/overlay/; revision=425
Diffstat (limited to 'gnustep-apps/sogo/files/sogod.initd')
-rw-r--r--gnustep-apps/sogo/files/sogod.initd74
1 files changed, 74 insertions, 0 deletions
diff --git a/gnustep-apps/sogo/files/sogod.initd b/gnustep-apps/sogo/files/sogod.initd
new file mode 100644
index 0000000..c370ba4
--- /dev/null
+++ b/gnustep-apps/sogo/files/sogod.initd
@@ -0,0 +1,74 @@
+#!/sbin/runscript
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+sogod_bin=""
+sogod_port=""
+
+depend() {
+ need net
+ after pg_autovacuum postgresql mysql
+ after slapd
+ after mta
+ after memcached
+}
+
+checkconfig() {
+ if [ -f "/etc/GNUstep/GNUstep.conf" ]; then
+ source /etc/GNUstep/GNUstep.conf
+ else
+ eerror "Can't find /etc/GNUstep/GNUstep.conf"
+ return 1
+ fi
+ if [ -x "${HOME}/${GNUSTEP_USER_DIR_ADMIN_TOOLS}/sogod" ]; then
+ sogod_bin="${HOME}/${GNUSTEP_USER_DIR_ADMIN_TOOLS}/sogod"
+ elif [ -x "${GNUSTEP_LOCAL_ADMIN_TOOLS}/sogod" ]; then
+ sogod_bin="${GNUSTEP_LOCAL_ADMIN_TOOLS}/sogod"
+ elif [ -x "${GNUSTEP_SYSTEM_ADMIN_TOOLS}/sogod" ]; then
+ sogod_bin="${GNUSTEP_SYSTEM_ADMIN_TOOLS}/sogod"
+ elif [ -x "${GNUSTEP_NETWORK_ADMIN_TOOLS}/sogod" ]; then
+ sogod_bin="${GNUSTEP_SYSTEM_ADMIN_TOOLS}/sogod"
+ else
+ eerror "Can't find sogod"
+ return 1
+ fi
+ if [ -f "${GNUSTEP_MAKEFILES}/GNUstep.sh" ]; then
+ source "${GNUSTEP_MAKEFILES}/GNUstep.sh"
+ else
+ eerror "Can't find ${GNUSTEP_MAKEFILES}/GNUstep.sh"
+ return 1
+ fi
+ sogod_port="$(defaults -u sogo read sogod WOPort 2>/dev/null)"
+ if [ "${?}" -eq 0 ]; then
+ sogod_port="${sogod_port##* }"
+ if [ "$((${sogod_port}+1-1))" != "${sogod_port}" ]; then
+ sogod_port="20000"
+ fi
+ else
+ sogod_port="20000"
+ fi
+ touch /var/log/sogod.log
+ chown sogo /var/log/sogod.log
+}
+
+start() {
+ checkconfig || return 1
+ ebegin "Starting SOGo service"
+ start-stop-daemon \
+ --start \
+ --exec ${sogod_bin} \
+ --chuid sogo \
+ --make-pidfile \
+ --background \
+ --pidfile /var/run/sogod.pid \
+ -- -WOPort ${sogod_port}
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping SOGo service"
+ start-stop-daemon --stop \
+ --pidfile /var/run/sogod.pid
+ eend ${?}
+}