Rev 43 | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/bin/bash## zarafa-monitor Zarafa Collaboration Platform's Quota Monitor## chkconfig: 345 86 24# description: The Zarafa Quota Monitor watches the store sizes \# of users, and sends warning emails when limits are exceeded.# processname: /usr/sbin/zarafa-monitor# config: /etc/zarafa/monitor.cfg# pidfile: /var/run/zarafad/monitor.pid### BEGIN INIT INFO# Provides: zarafa-monitor# 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 Platform's Quota Monitor# Description: The Zarafa Quota Monitor watches the store sizes# of users, and sends warning emails when limits are exceeded.### END INIT INFOMONITORCONFIG=/etc/zarafa/monitor.cfgMONITORPROGRAM=/usr/sbin/zarafa-monitor# Sanity checks.[ -x $MONITORPROGRAM ] || exit 0MONITORCONFIG_OPT=""[ ! -z $MONITORCONFIG -a -f $MONITORCONFIG ] && MONITORCONFIG_OPT="-c $MONITORCONFIG"[ -f /etc/sysconfig/zarafa ] && . /etc/sysconfig/zarafaif [ -z "$ZARAFA_LOCALE" ]; thenZARAFA_LOCALE="C"fi# Source function library.. /etc/rc.d/init.d/functionsRETVAL=0monitor=`basename $MONITORPROGRAM`lockfile=/var/lock/subsys/$monitorpidfile=/var/run/zarafad/monitor.pidstart() {# Start in background, always succeedsecho -n $"Starting $monitor: "install -dm0775 -o zarafa -g zarafa /var/run/zarafadexport LC_ALL=$ZARAFA_LOCALEexport LANG=$ZARAFA_LOCALEdaemon $MONITORPROGRAM $MONITORCONFIG_OPTRETVAL=$?unset LC_ALL LANGecho[ $RETVAL -eq 0 ] && touch $lockfilereturn $RETVAL}stop() {echo -n $"Stopping $monitor: "killproc $MONITORPROGRAMRETVAL=$?echo[ $RETVAL -eq 0 ] && rm -f $lockfile $pidfilereturn $RETVAL}restart() {stopstart}reload() {echo -n $"Restarting $monitor: "killproc $MONITORPROGRAM -SIGHUPRETVAL=$?echoreturn $RETVAL}# See how we were called.case "$1" instart)start;;stop)stop;;status)status $monitorRETVAL=$?;;restart|force-reload)restart;;condrestart|try-restart)if [ -f ${pidfile} ]; thenstopstartfi;;reload)reload;;*)echo $"Usage: $monitor {start|stop|status|reload|restart|condrestart|force-reload|try-restart}"RETVAL=1;;esacexit $RETVAL