Suse Init Script
From Kolab wiki
[edit]
Init Script to start Kolab 2 Server
#!/bin/sh
## Copyright (c) 2004-2005 Erfrakon, Stuttgart, Germany.
# All rights reserved.
# Distributed under the Terms of the GPL2
# Author: Martin Konold
# Please send feedback to martin.konold@erfrakon.de
#
# /etc/init.d/kolab
# and its symbolic link
# /sbin/rckolab
#
# sartup script for the Kolab 2 Groupware Server
#
# LSB compatible service control script; see http://www.linuxbase.org/spec/
#
### BEGIN INIT INFO
# Provides: kolab
# Required-Start: $local_fs $network $named $time
# Should-Start:
# Required-Stop:
# Should-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Kolab 2 server providing full groupware services (smtp, pop3, imap, http)
# Description: Start Kolab to allow your server to provide full groupware services.
# Running Kolab requires to stop other services requiring the same network ports.
# Kolab provides OpenLDAP, Apache, Postfix, Cyrus IMAPD and the Kolab Daemon
### END INIT INFO
KOLAB_BIN=/kolab/bin/openpkg
test -x $KOLAB_BIN || { echo "$KOLAB_BIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
# Check for existence of needed config file and read it
KOLAB_CONFIG=/kolab/etc/kolab/kolab.conf
test -r $KOLAB_CONFIG || { echo "$KOLAB_CONFIG not existing";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
. /etc/rc.status
rc_reset
case "$1" in
start)
echo -n "Starting Kolab "
exec /kolab/bin/openpkg rc all start
rc_status -v
;;
stop)
echo -n "Shutting down Kolab "
exec /kolab/bin/openpkg rc all stop
rc_status -v
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
# Remember status and be quiet
rc_status
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
rc_exit
