diff options
author | Chris Walker <kris240376@gmail.com> | 2018-10-20 22:12:07 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2018-10-21 06:47:03 +0700 |
commit | 18c122f275bda96962a727040d4697c678d9a01c (patch) | |
tree | d7742536ede231daa6d32d7ce270c2c299130848 /office/SOGo/rc.sogod | |
parent | d99dcba158045657653572c515d7c146e1c9c6d3 (diff) | |
download | slackbuilds-18c122f275bda96962a727040d4697c678d9a01c.tar.gz slackbuilds-18c122f275bda96962a727040d4697c678d9a01c.tar.xz |
office/SOGo: Updated for version 4.0.3.
Signed-off-by: David Spencer <baildon.research@googlemail.com>
Diffstat (limited to 'office/SOGo/rc.sogod')
-rw-r--r-- | office/SOGo/rc.sogod | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/office/SOGo/rc.sogod b/office/SOGo/rc.sogod new file mode 100644 index 0000000000..55ef759643 --- /dev/null +++ b/office/SOGo/rc.sogod @@ -0,0 +1,70 @@ +#!/bin/bash +# +# /etc/rc.d/rc.sogod +# +# Start/stop/restart the SOGo groupware server. +# +# This script was inspired by the RHEL init.d script present in the +# SOGo source Scripts directory. +# + +# These values are defaults. You can update the USER and PREFORK values +# by making changes to /etc/sysconfig/sogo. +USER=sogo +PREFORK=3 + +PIDFILE=/var/run/sogo/sogo.pid +LOGFILE=/var/log/sogo/sogo.log + +if [ -f /etc/sysconfig/sogo ]; then + . /etc/sysconfig/sogo +fi + +DAEMON_OPTS="-WOWorkersCount $PREFORK -WOPidFile $PIDFILE -WOLogFile $LOGFILE" + +if [ -z "$GNUSTEP_SYSTEM_ROOT" ]; then + . /etc/GNUstep/GNUstep.conf + . ${GNUSTEP_MAKEFILES}/GNUstep.sh +fi + +sogo_start() { + pid="$(cat $PIDFILE 2> /dev/null)" + if [ -n "$pid" ]; then + pid="$(ps --pid ${pid} -o pid=)" + if [ ! -n "$pid" ]; then + rm -f $PIDFILE + su - $USER -c "nohup /usr/sbin/sogod $DAEMON_OPTS >/dev/null 2>&1" + echo "Starting SOGo: /usr/sbin/sogod $DAEMON_OPTS" + fi + else + su - $USER -c "nohup /usr/sbin/sogod $DAEMON_OPTS >/dev/null 2>&1" + echo "Starting SOGo: /usr/sbin/sogod $DAEMON_OPTS" + fi +} + +sogo_stop() { + pid="$(cat $PIDFILE 2> /dev/null)" + if [ -n "$pid" ]; then + pid="$(ps --pid ${pid} -o pid=)" + if [ -n "$pid" ]; then + kill $pid >& /dev/null + echo "Stopping SOGo..." + fi + fi +} + +case "$1" in + start) + sogo_start + ;; + stop) + sogo_stop + ;; + restart) + sogo_stop + sleep 2 + sogo_start + ;; + *) + sogo_start +esac |