Rev 43 | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/bin/bash## zarafa-spooler Zarafa Collaboration Server's Spooler Daemon## chkconfig: 345 86 24# description: The Zarafa Spooler is responsible for converting \# MAPI messages to the internet format and sending \# using your MTA as configured.# processname: /usr/sbin/zarafa-spooler# config: /etc/zarafa/spooler.cfg# pidfile: /var/run/zarafad/spooler.pid### BEGIN INIT INFO# Provides: zarafa-spooler# Required-Start: $local_fs $network $remote_fs $syslog# Required-Stop: $local_fs $network $remote_fs $syslog# Should-Start: zarafa-server# Should-Stop: zarafa-server# Short-Description: Zarafa Collaboration Server's Spooler Daemon# Description: The Zarafa Spooler is responsible for converting# MAPI messages to the internet format and sending# using your MTA as configured.### END INIT INFOSPOOLERCONFIG=/etc/zarafa/spooler.cfgSPOOLERPROGRAM=/usr/sbin/zarafa-spooler# Sanity checks.[ -x $SPOOLERPROGRAM ] || exit 0SPOOLERCONFIG_OPT=""[ ! -z $SPOOLERCONFIG -a -f $SPOOLERCONFIG ] && SPOOLERCONFIG_OPT="-c $SPOOLERCONFIG"[ -f /etc/sysconfig/zarafa ] && . /etc/sysconfig/zarafaif [ -z "$ZARAFA_LOCALE" ]; thenZARAFA_LOCALE="C"fi# Source function library.. /etc/rc.d/init.d/functionsRETVAL=0spooler=`basename $SPOOLERPROGRAM`lockfile=/var/lock/subsys/$spoolerpidfile=/var/run/zarafad/spooler.pidstart() {# Start in background, always succeedsecho -n $"Starting $spooler: "install -dm0775 -o zarafa -g zarafa /var/run/zarafadexport LC_ALL=$ZARAFA_LOCALEexport LANG=$ZARAFA_LOCALEdaemon $SPOOLERPROGRAM $SPOOLERCONFIG_OPTRETVAL=$?unset LC_ALL LANGecho[ $RETVAL -eq 0 ] && touch $lockfilereturn $RETVAL}stop() {echo -n $"Stopping $spooler: "killproc $SPOOLERPROGRAMRETVAL=$?echo[ $RETVAL -eq 0 ] && rm -f $lockfile $pidfilereturn $RETVAL}restart() {stopstart}reload() {echo -n $"Restarting $spooler: "killproc $SPOOLERPROGRAM -SIGHUPRETVAL=$?echoreturn $RETVAL}# See how we were called.case "$1" instart)start;;stop)stop;;status)status $spoolerRETVAL=$?;;restart|force-reload)restart;;condrestart|try-restart)if [ -f ${pidfile} ]; thenstopstartfi;;reload)reload;;*)echo $"Usage: $spooler {start|stop|status|reload|restart|condrestart|force-reload|try-restart}"RETVAL=1;;esacexit $RETVAL