Douglas,

I have attached a script, for Red Hat, that will allow you to treat Cyrus like
any other service, and control its behavior using run level editing tools.
Simply copy this file into /etc/rc.d/init.d and make sure it has the same perms
as everything else in the directory.

Then you can run "setup" and select "system services" and this will show up.
Also, you can type "service cyrus start" and "service cyrus stop" from the
command line.

-John

"Kevin J. Menard, Jr." wrote:

> Hey Douglas,
>
> Wednesday, July 11, 2001, 10:11:01 PM, you wrote:
>
> DAS> Hi,
>
> DAS> I'm trying to configure my RH 7.0 box to start /usr/cyrus/bin/master at
> DAS> boot, but the script I created hangs on
>
> DAS> daemon /usr/cyrus/bin/master
>
> DAS> is this the "proper" way to do this? Could someone show me how they've
> DAS> accomplished this? Is it at all possible to run imapd and friends via
> DAS> inetd?
>
> I would background the process.  Otherwise, your init script is going to
> hang there.
>
> --
>  Kevin

--
______________________________________________
John C. Amodeo, Associate Director
Information Technology and Computer Operations
Faculty of Arts & Sciences, Rutgers University
732.932.9455-voice 732.932.0013-fax

#!/bin/sh
#
# chkconfig: - 51 49
# description: The Cyrus IMAPD Master Process
#
# config: /etc/cyrus.conf
 
# source function library
. /etc/rc.d/init.d/functions

RETVAL=0

stop() {
        echo -n "Stopping Cyrus IMAP Master:"
        killproc /usr/cyrus/bin/master
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/cyrus
}

start() {
        [ -f /var/lock/subsys/cyrus ] && stop
        echo -n "Starting Cyrus IMAP Master:"
        /usr/cyrus/bin/master &
        sleep 1
        action "" /sbin/pidof /usr/cyrus/bin/master
        RETVAL=$?
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cyrus
}

restart() {
        stop
        start
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  condrestart)
        [ -f /var/lock/subsys/cyimap ] && restart || : 
        ;;
  status)
        status /usr/cyrus/bin/master
        RETVAL=$?
        ;;
  *)
        echo "Usage: cyrus {start|stop|restart|condrestart|status}"
        RETVAL=1
esac

exit $RETVAL

Reply via email to