pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/43960: pkgsrc/devel/cvsup add sample RC script



The following reply was made to PR pkg/43960; it has been noted by GNATS.

From: "Brian A. Seklecki" <bseklecki%collaborativefusion.com@localhost>
To: gnats-bugs%NetBSD.org@localhost, motoyuki%bsdclub.org@localhost
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--
 
 


Home | Main Index | Thread Index | Old Index