head	1.5;
access;
symbols
	TIGRIS_1_0_8_1:1.5
	TIGRIS_1_0_8_0:1.5
	TIGRIS_1_0_4:1.3;
locks; strict;
comment	@# @;


1.5
date	2001.07.19.23.07.51;	author thom;	state Exp;
branches;
next	1.4;

1.4
date	2001.07.17.00.10.53;	author stephane;	state Exp;
branches;
next	1.3;

1.3
date	2001.04.25.15.47.11;	author edk;	state Exp;
branches;
next	1.2;

1.2
date	2001.04.25.15.38.19;	author edk;	state Exp;
branches;
next	1.1;

1.1
date	2001.04.20.23.05.58;	author stephane;	state Exp;
branches;
next	;


desc
@@


1.5
log
@modified so that chkconfig will work
Issue number:
Obtained from:
Submitted by:
Reviewed by:
@
text
@#!/bin/sh
#
# chkconfig: 2345 20 80
# description: allow the cvs repository to \
#              be mirrored on a different machine
#
DESC="cvsup server"

NAME=cvsup
CVSUPD=/usr/sbin/cvsupd
BASEDIR=/usr/local/tigris/cvsupd
COMPLEVEL=2
LOGFILE=/usr/local/tigris/log/cvsupd.log

if [ X$CVSUPD = X ]; then
    echo "cvsupd not configured"
    exit 0
fi

# Source function library.
. /etc/rc.d/init.d/functions


# Get config.
. /etc/sysconfig/network

# Check that networking is up.
if [ ${NETWORKING} = "no" ]; then
    exit 0
fi

if [ ! -x $CVSUPD ]; then
    echo "cvsupd not found"
    exit 1
fi

if [ ! -d $BASEDIR ]; then
    echo "cvsupd base directory not found"
    exit 1
fi

RETVAL=0

command="$CVSUPD -b $BASEDIR -C $COMPLEVEL -l $LOGFILE"

case "$1" in
	start)
		echo -n "Starting $DESC:"
                touch $LOGFILE
		chown cvsupd $LOGFILE
	        daemon --user cvsupd $command
		echo "$NAME."
		RETVAL=$?
		;;
		
	stop)
		echo -n "Stopping $DESC:"
		killall $CVSUPD
		echo "$NAME."
		RETVAL=$?
		;;

	restart)
		echo -n "Restarting $DESC:"
		killall $CVSUPD
		sleep 1
		daemon --user cvsupd $command
		echo "$NAME."
		RETVAL=$?
		;;

	*)
		echo "Usage: $0 {start|stop|restart}"
		exit 1
esac

exit $REVAL
@


1.4
log
@added chkconfig line
@
text
@d2 1
d4 4
a8 1
CVSUP=/usr/local/sbin/cvsupd
d10 8
a17 7
CVSUPDLOG=/usr/local/tigris/log/error/cvsupd-error.log
DESC="cvsup server"
CONF=/etc/cvsupd

if [ X$CVSUP = X ]; then
	echo "cvsup not found"
	exit 0
d28 2
a29 3
if [ ${NETWORKING} = "no" ]
then
        exit 0
d32 9
a40 1
[ -f $CVSUP ] || exit 0
d44 2
d49 3
a51 4
		touch $CVSUPDLOG
		chown cvsupd $CVSUPDLOG
		daemon --user cvsupd $CVSUP -b $CONF -C 1 -l $CVSUPDLOG 
		#touch $CVSUPLOCK
d58 1
a58 1
		killall $CVSUP
d65 1
a65 1
		killall $CVSUP
d67 1
a67 1
		daemon --user cvsupd $CVSUP -b $CONF -C 1 -l $CVSUPDLOG
@


1.3
log
@change /etc/cvsup to /etc/cvsupd
@
text
@d2 1
@


1.2
log
@refer to cvsupd using the directory in which was installed, ditto for
the conf in /etc/ ; don't use touch with an empty file name; create
and chown the log
@
text
@d7 1
a7 1
CONF=/etc/cvsup
@


1.1
log
@Added an RPM for cvsup.
@
text
@d3 1
a3 1
CVSUP=/usr/sbin/cvsupd
d7 1
a7 1
CONF=/etc/cvsupd
d34 2
d37 1
a37 1
		touch $CVSUPLOCK
@

