Rev 43 | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/bin/bash## zarafa-licensed The Zarafa Collaboration Platform's License Daemon## chkconfig: 345 84 24# description: This package adds a licensing daemon to the Zarafa Collaboration \# Platform. This daemon is needed to run propietary add-ons, like the \# Microsoft Outlook client.# processname: /usr/sbin/zarafa-licensed# config: /etc/zarafa/licensed.cfg# pidfile: /var/run/zarafad/licensed.pid### BEGIN INIT INFO# Provides: zarafa-licensed# Required-Start: $local_fs $network $remote_fs $syslog# Required-Stop: $local_fs $network $remote_fs $syslog# X-Start-Before: zarafa-server# Should-Stop: zarafa-server# Short-Description: The Zarafa Collaboration Platform's License Daemon# Description: This package adds a licensing daemon to the Zarafa Collaboration# Platform. This daemon is needed to run propietary add-ons, like the# Microsoft Outlook client.### END INIT INFOLICENSEDCONFIG=/etc/zarafa/licensed.cfgLICENSEDPROGRAM=/usr/sbin/zarafa-licensed# Sanity checks.[ -x $LICENSEDPROGRAM ] || exit 0LICENSEDCONFIG_OPT=""[ ! -z $LICENSEDCONFIG -a -f $LICENSEDCONFIG ] && LICENSEDCONFIG_OPT="-c $LICENSEDCONFIG"[ -f /etc/sysconfig/zarafa ] && . /etc/sysconfig/zarafaif [ -z "$ZARAFA_LOCALE" ]; thenZARAFA_LOCALE="C"fi# Source function library.. /etc/rc.d/init.d/functionsRETVAL=0licensed=`basename $LICENSEDPROGRAM`lockfile=/var/lock/subsys/$licensedpidfile=/var/run/zarafad/licensed.pidstart() {# Start in background, always succeedsecho -n $"Starting $licensed: "install -dm0775 -o zarafa -g zarafa /var/run/zarafadexport LC_ALL=$ZARAFA_LOCALEexport LANG=$ZARAFA_LOCALEdaemon $LICENSEDPROGRAM $LICENSEDCONFIG_OPTRETVAL=$?unset LC_ALL LANGecho[ $RETVAL -eq 0 ] && touch $lockfilereturn $RETVAL}stop() {echo -n $"Stopping $licensed: "killproc $LICENSEDPROGRAMRETVAL=$?echo[ $RETVAL -eq 0 ] && rm -f $lockfile $pidfilereturn $RETVAL}restart() {stopstart}reload() {echo -n $"Restarting $licensed: "killproc $LICENSEDPROGRAM -SIGHUPRETVAL=$?echoreturn $RETVAL}# See how we were called.case "$1" instart)start;;stop)stop;;status)status $licensedRETVAL=$?;;restart|force-reload)restart;;condrestart|try-restart)if [ -f ${pidfile} ]; thenstopstartfi;;reload)reload;;*)echo $"Usage: $licensed {start|stop|status|reload|restart|condrestart|force-reload|try-restart}"RETVAL=1;;esacexit $RETVAL