summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'gnustep-apps/sogo/files')
-rw-r--r--gnustep-apps/sogo/files/sogo.initd23
-rw-r--r--gnustep-apps/sogo/files/sogod.initd74
2 files changed, 74 insertions, 23 deletions
diff --git a/gnustep-apps/sogo/files/sogo.initd b/gnustep-apps/sogo/files/sogo.initd
deleted file mode 100644
index 766b37f..0000000
--- a/gnustep-apps/sogo/files/sogo.initd
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/sbin/runscript
-# Copyright 1999-2009 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: $
-
-depend() {
- need net
- after postgresql
-}
-
-start() {
- ebegin "Starting SOGo service"
- start-stop-daemon --start --exec /usr/GNUstep/System/Tools/Admin/sogod \
- --chuid sogo -m -b --pidfile /var/run/sope.pid
- eend $?
-}
-
-stop() {
- ebegin "Stopping SOGo service"
- start-stop-daemon --stop \
- --pidfile /var/run/sope.pid
- eend $?
-}
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 ${?}
+}