Ik kwam dit tegen en heb het zelf daarmee vlekkeloos werkend gekregen:
Debian Init Script for Kerio Mail Server:
I usually like to use open source software for my stuff, but recently had good results using Kerio Mail Server for a client, and I'm in need of getting my internal mail system humming again. I don't have time to figure out how to set up postfix, imap, pop, webmail, etc. etc. on my Ubuntu box, so I'm going with Kerio. The problem is, Kerio isn't open source and is distributed in RPM format.
Step one is to use alien to convert the RPM to a DEB, and then use dpkg --install to get it on your system. Step two is to convert the System V init script from RedHat style to Debian style. First, download my script:
http://www.paulmcnett.com...ing/Linux/keriomailserver (heb ik hieronder gepost)
Rename '/etc/init.d/keriomailserver' to '/etc/init.d/keriomailserver.orig', download my script to /etc/init.d/keriomailserver, and make sure it is executable using 'chmod 755 keriomailserver'.
Remember to run kerio's initial configuration script in '/opt/kerio/mailserver/cfgwizard', and then try to use your new startup script to start the server by issuing '/etc/init.d/keriomailserver start'. If it worked, you should see a process id by issuing 'cat /var/run/kms.pid'. If you got a message that the file didn't exist, there is a problem. Try also issuing the other init commands like '/etc/init.d/keriomailserver stop' and 'keriomailserver restart'.
The next step is to get it set to load automatically on system boot. To do this, just make a symlink from the appropriate runlevel directory. On my Ubuntu box, that is '/etc/rc2.d', and here is what I did:
cd /etc/rc2.d
ln -s /etc/init.d/keriomailserver S20keriomailserver
Kerio appears to be working just fine on my Ubuntu system, but getting the System V init stuff right only makes the administration easier.
Script:
#! /bin/sh
set -e
# /etc/init.d/keriomailserver
# Paul McNett 5/2/2005
. /lib/lsb/init-functions
DESCRIPTION="Kerio Mail Server"
PIDFILE="/var/run/kms.pid"
MAINDIR="/opt/kerio/mailserver"
EXEC="$MAINDIR/mailserver"
if [ -f /etc/keriomailserver ] ; then
. /etc/keriomailserver
fi
case "$1" in
start)
log_begin_msg "Starting $DESCRIPTION..."
start-stop-daemon --start --pidfile $PIDFILE --exec $EXEC $MAINDIR || log_end_msg 1
log_end_msg 0
;;
stop)
log_begin_msg "Stopping $DESCRIPTION..."
start-stop-daemon --stop --oknodo --pidfile $PIDFILE || log_end_msg 1
log_end_msg 0
;;
reload|force-reload)
log_begin_msg "Reloading $DESCRIPTION's configuration"
start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile $PIDFILE --exec $EXEC $MAINDIR || log_end_msg 1
log_end_msg 0
;;
restart)
log_begin_msg "Restarting $DESCRIPTION..."
start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $PIDFILE
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $EXEC $MAINDIR || log_end_msg 1
log_end_msg 0
;;
*)
log_success_msg "Usage: /etc/init.d/keriomailserver {start|stop|reload|force-reload|restart}"
exit 1
esac
exit 0