Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Feb 1999 08:37:37 +1300
From:      "Dan Langille" <junkmale@xtra.co.nz>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Re: how do I start cvsupd?
Message-ID:  <19990203193736.KXIR682101.mta1-rme@wocker>
In-Reply-To: <19990203083455.IDNO682101.mta1-rme@wocker>

next in thread | previous in thread | raw e-mail | index | archive | help
On 3 Feb 99, at 21:34, Dan Langille wrote:

> I'm in the process of starting up a freebsd mirror site.  The port appears 
> to have installed correctly.  cvsupd was going out and asking for files.  
> It wasn't getting any because it was looking at freefall.freebsd.org and 
> it was not configured for my firewall.
> 
> So I've modified /usr/local/etc/cvsup/update.sh to include "-P -" to 
> select passive mode.  I've also changed /usr/local/etc/cvsup/config.sh to 
> include the following line:
> 
> host="cvsup.au.FreeBSD.org"
> 
> My problem is not knowing how to start cvsupd from the command line.
> 
> /usr/local/etc/rc.d/cvsupd.sh contains:
> 
> ! /bin/sh
> 
> if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/cvsupd\.sh\$"); then
>     echo "$0: Cannot determine the PREFIX" >&2
>     exit 1
> fi
> base=${PREFIX}/etc/cvsup
> out=/var/tmp/cvsupd.out
> 
> export PATH=/bin:/usr/bin:${PREFIX}/sbin
> umask 2
> 
> test -x ${PREFIX}/sbin/cvsupd || exit 1
> echo -n " cvsupd"
> cd ${base} || exit
> . ./config.sh || exit
> su -m ${user} -c \
>     "cvsupd -e -C ${maxclients} -l @${facility} -s sup.client" >>${out} 
> 2>&1
> 
> 
> But if I run it I get:
> 
> [root@ns:/usr/local/etc/rc.d] # ./cvsupd.sh 
> ./cvsupd.sh: Cannot determine the PREFIX
> 
> I'm assuming PREFIX should be /usr/local.  But that's as far as I can get.
> 
> cheers.
> 

I now have what I think is a solution.  I removed the first few lines of 
the shell.  mycvsupd.sh contains:

#! /bin/sh

base=${PREFIX}/etc/cvsup                                       
out=/var/tmp/cvsupd.out

export PATH=/bin:/usr/bin:${PREFIX}/sbin
umask 2

test -x ${PREFIX}/sbin/cvsupd || exit 1
echo -n " cvsupd"
cd ${base} || exit
. ./config.sh || exit
su -m ${user} -c \
    "cvsupd -e -C ${maxclients} -l @${facility} -s sup.client" >>${out} 
2>&1


running the script gives:

[root@ns:/usr/local/etc/rc.d] # ./mycvsupd.sh 
 cvsupd[root@ns:/usr/local/etc/rc.d] # ps -auws | grep cvsup


[root@ns:/usr/local/etc/rc.d] # ps -auwx | grep cvsup
root       188 56.1 17.4  1492 2472  ??  R     7:34AM   16:27.76 cvsup -
1gL 1 -c sup.client -h cvsup.au.FreeBSD.org -P - supfile.no
root       160  0.0  1.3   484  180  ??  Is    7:33AM    0:00.21 /bin/sh -
c /usr/local/etc/cvsup/update.sh
root       161  0.0  1.3   492  184  ??  I     7:33AM    0:00.39 /bin/sh 
/usr/local/etc/cvsup/update.sh
root       183  0.0  1.9   140  260  ??  I     7:33AM    0:00.14 lockf -t 
0 /var/spool/lock/cvsup.lock /bin/sh
cvsup      244  0.0  9.3   908 1312  ??  Is    8:01AM    0:00.12 cvsupd -e 
-C 8 -l @daemon -s sup.client
root       248  0.0  4.0   176  560  p1  R+    8:02AM    0:00.24 grep cvsup

So it looks like it's running.  But I doubt it has the correct settings.  
I have yet to test it as a server.  Any suggestions as to the cvsupd.sh 
script?

--
Dan Langille
The FreeBSD Diary
http://www.FreeBSDDiary.com/freebsd

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990203193736.KXIR682101.mta1-rme>