NetBSD Problem Report #43960
From www@NetBSD.org Sun Oct 10 22:59:32 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by www.NetBSD.org (Postfix) with ESMTP id 3013363BBD6
for <gnats-bugs@gnats.NetBSD.org>; Sun, 10 Oct 2010 22:59:32 +0000 (UTC)
Message-Id: <20101010225931.EF40063B94B@www.NetBSD.org>
Date: Sun, 10 Oct 2010 22:59:31 +0000 (UTC)
From: bseklecki@collaborativefusion.com
Reply-To: bseklecki@collaborativefusion.com
To: gnats-bugs@NetBSD.org
Subject: pkgsrc/devel/cvsup add sample RC script
X-Send-Pr-Version: www-1.0
>Number: 43960
>Category: pkg
>Synopsis: pkgsrc/devel/cvsup add sample RC script
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: pkg-manager
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sun Oct 10 23:00:00 +0000 2010
>Closed-Date: Wed Jan 01 12:05:05 +0000 2014
>Last-Modified: Wed Jan 01 12:05:05 +0000 2014
>Originator: Brian A. Seklecki
>Release: NetBSD metrotitan 5.99.39 NetBSD 5.99.39 (METROTITAN-$Revision: 1.993 $) #0: Wed Oct 6 13:26:31 EDT 2010 root@metrotitan:/usr/obj/sys/arch/i386/compile/METROTITAN i386
>Organization:
Collaborative Fusion, Inc.
>Environment:
NetBSD metrotitan 5.99.39 NetBSD 5.99.39 (METROTITAN-$Revision: 1.993 $) #0: Wed Oct 6 13:26:31 EDT 2010 root@metrotitan:/usr/obj/sys/arch/i386/compile/METROTITAN i386
>Description:
Systems with daemonizing service normally ship an RC script to egg you along:
bash-4.1# grep -ri rcd /usr/pkgsrc/net/rsync/
/usr/pkgsrc/net/rsync/Makefile:RCD_SCRIPTS= rsyncd
/usr/pkgsrc/net/rsync/Makefile:RCD_SCRIPT_SRC.rsyncd= files/rsyncd.sh
/usr/pkgsrc/net/rsync/files/rsyncd.sh:#!@RCD_SCRIPTS_SHELL@
However CVSUP doesn't ship one:
bash-4.1# grep -ri rcd /usr/pkgsrc/devel/cvsup*
As a side note, more proliferated use of cvsupd would significantly reduce the load on the main anoncvs.netbsd.org mirror.
>How-To-Repeat:
Install cvsupd; proceed to configure it for autostart in rc.conf(5).... D`oh!
>Fix:
Ship a file such as the patch below:
# diff -u ~bseklecki/Makefile.common.cvsupd Makefile.common
--- /home/bseklecki/Makefile.common.cvsupd 2010-10-10 18:44:27.000000000 -0400
+++ Makefile.common 2010-10-10 18:44:53.000000000 -0400
@@ -37,6 +37,10 @@
BUILD_DEFS+= CVSUP_STATIC
CVSUP_STATIC?= NO
+RCD_SCRIPTS= cvsupd
+RCD_SCRIPT_SRC.cvsupd= files/cvsupd.sh
+
+
.if defined(CVSUP_STATIC) && !empty(CVSUP_STATIC:M[Yy][Ee][Ss])
M3FLAGS+= -DSTATIC
STATIC= -static
----------------------------------------------------
----------------------------------------------------
----------------------------------------------------
bash-4.1# more files/cvsupd.sh
#!/bin/sh
#
# $NetBSD$
#
# PROVIDE: cvsupd
# REQUIRE: DAEMON
. /etc/rc.subr
name="cvsupd"
rcvar=$name
command="@PREFIX@/sbin/${name}"
#pidfile="/var/run/${name}.pid"
[ -z "$cvsupd_user" ] && cvsupd_user="cvsupd"
[ -z "$cvsupd_basedir" ] && cvsupd_basedir="@PKG_SYSCONFDIR@/cvsup"
[ -z "$cvsupd_maxclients" ] && cvsupd_maxclients="8"
[ -z "$cvsupd_syslogfacil" ] && cvsupd_syslogfacil="@local0"
[ -z "$cvsupd_collection_dir" ] && cvsupd_collection_dir="sup" # If not absolute, relative to $basedir
[ -z "$cvsupd_mirrormode_scandir" ] && cvsupd_mirrormode_scandir="sup-client-scan" # If not absolute, relative to $basedir
# Config files, which are read in a compound fashion, are stored within
# {$basedir:="/usr/pkg/etc/cvsup}/sup/*/*, by default, one subdir for each
# collection
command_args="-e -C ${cvsupd_maxclients} -l ${cvsupd_syslogfacil} -b ${cvsupd_basedir} -c ${cvsupd_collection_dir} -s ${cvsupd_mirrormod_scandir}"
load_rc_config $name
run_rc_command "$1"
>Release-Note:
>Audit-Trail:
From: "Brian A. Seklecki" <bseklecki@collaborativefusion.com>
To: gnats-bugs@NetBSD.org, motoyuki@bsdclub.org
Cc:
Subject: Re: pkg/43960: pkgsrc/devel/cvsup add sample RC script
Date: Sun, 10 Oct 2010 19:44:38 -0400
--=-Ra6CxGtnZMkEi7k/XYOw
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Sorry. In the initial example, load_rc_config $name did not come sufficien=
tly soon to take effect.
Also, I'll have to check our ksh/sh(1) in all supported version, but there =
are a couple of different ways of accomplishing the default variable assign=
ments
FreeBSD does it:
: ${cvsupd_mirrormode_scandir:=3D"sup-client-scan"
Apache likes (probably most POSIX):
[ -z "$cvsupd_mirrormode_scandir" ] && cvsupd_mirrormode_scandir=3D"sup-cli=
ent-scan" =20
I like:
cvsupd_mirrormode_scandir=3D${cvsupd_mirrormode_scandir:=3D"sup-client-s=
can"}=20
For sure it should be ":=3D" instead of ":-", because the variable will nev=
er be initialized but set to null or not null prior to the script
-------------------
#!/bin/sh
#
# $NetBSD$
#
# PROVIDE: cvsupd
# REQUIRE: DAEMON
$_rc_subr_loaded . /etc/rc.subr
name=3D"cvsupd"
rcvar=3D$name
command=3D"/usr/pkg/sbin/${name}"
#pidfile=3D"/var/run/${name}.pid"
load_rc_config $name
[ -z "$cvsupd_user" ] && cvsupd_user=3D"cvsupd"
[ -z "$cvsupd_basedir" ] && cvsupd_basedir=3D"/usr/pkg/etc/cvsup"
[ -z "$cvsupd_maxclients" ] && cvsupd_maxclients=3D"8"
[ -z "$cvsupd_syslogfacil" ] && cvsupd_syslogfacil=3D"@local0"
[ -z "$cvsupd_collection_dir" ] && cvsupd_collection_dir=3D"sup" =
# If not absolute, relative to $basedir
[ -z "$cvsupd_mirrormode_scandir" ] && cvsupd_mirrormode_scandir=3D"sup-cli=
ent-scan" # If not absolute, relative to $basedir
# Config files, which are read in a compound fasion, are stored within
# {$basedir:=3D"/usr/pkg/etc/cvsup}/sup/*/*, by default, one subdir for eac=
h
# collection
command_args=3D"-e -C ${cvsupd_maxclients} -l ${cvsupd_syslogfacil} -b ${cv=
supd_basedir} -c ${cvsupd_collection_dir} -s ${cvsupd_mirrormode_scandir}"
run_rc_command "$1"
--=-Ra6CxGtnZMkEi7k/XYOw
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEABECAAYFAkyyT+YACgkQCne6BNDQ+R/V+wCfSZJxUM5Zv/BaEeYtPbYbM2rW
P1AAnAxx7pEt91tOYgT0xMeWQ9w8wBHv
=xGyk
-----END PGP SIGNATURE-----
--=-Ra6CxGtnZMkEi7k/XYOw--
From: "Brian A. Seklecki" <bseklecki@collaborativefusion.com>
To: gnats-bugs@NetBSD.org, motoyuki@bsdclub.org
Cc:
Subject: Re: pkg/43960: pkgsrc/devel/cvsup add sample RC script
Date: Sun, 10 Oct 2010 19:46:16 -0400
--=-4oqfrH5PwODZzVLqHBmj
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
While where here, you may want to mention in MESSAGE.NetBSD, that,
because cvsupd lacks IPv6 socket support, IPv6 server support can be
added using pkgsrc/net/nc6/ or faith(8) for v6-enabled clients like
pkgsrc/net/csup/
~BAS
--=-4oqfrH5PwODZzVLqHBmj
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEABECAAYFAkyyUEgACgkQCne6BNDQ+R9w1wCfa2PtfG5E8pAiEKcsr5dkGKmU
fWkAnAlW4EC2Nd2o0YuTlf3TpisnPAUW
=RtHw
-----END PGP SIGNATURE-----
--=-4oqfrH5PwODZzVLqHBmj--
State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Wed, 01 Jan 2014 12:05:05 +0000
State-Changed-Why:
cvsup was removed from pkgsrc.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.