Subject: Startup scripts (patch proposal)
To: None <tech-pkg@netbsd.org>
From: Julio Merino <jmmv@hispabsd.org>
List: tech-pkg
Date: 05/23/2002 10:26:02
--cvVnyQ+4j833TQvp
Content-Type: multipart/mixed; boundary="mP3DRpeJDSE+ciuQ"
Content-Disposition: inline


--mP3DRpeJDSE+ciuQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi all

I've been looking in bsd.pkg.install.mk to see how it handles rc.d startup
scripts. There are some things that are not ok, IMHO. I've done some
minor changes to modify the behavior that it has now.

Currently, startup scripts are installed under ${PREFIX}/etc/rc.d. As you
see, there is no PKG_SYSCONFDIR here, so they are always installed into
etc/rc.d. The other problem is about the ability to install those scripts
by default, with the variable INSTALL_RCD_SCRIPTS; it is currently set
to NO. If set to yes, it installs scripts to /etc/rc.d. We have now a
better way to specify directories which contain startup scripts in rc.conf,
so this is not good as it installs pkg files togheter with system files.

The patch changes default installation of scripts to
${PREFIX}/share/examples/rc.d. Packages install scripts there, registering
them in the PLIST. Then, the INSTALL/DEINSTALL scripts take care to move
those scripts to ${PKG_SYSCONFBASE}/rc.d if the INSTALL_RCD_SCRIPTS variable
is set. As they are not installed under /etc/rc.d, I've changed this var
default value to YES.

Patch is attached.

What do you think?

Thanks.

--=20
Of course it runs NetBSD - http://www.netbsd.org
HispaBSD member - http://www.hispabsd.org
Julio Merino <jmmv@hispabsd.org>

--mP3DRpeJDSE+ciuQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="patch.diff"
Content-Transfer-Encoding: quoted-printable

Index: bsd.pkg.install.mk
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.install.mk,v
retrieving revision 1.18
diff -u -u -r1.18 bsd.pkg.install.mk
--- bsd.pkg.install.mk	2002/03/18 15:17:55	1.18
+++ bsd.pkg.install.mk	2002/05/23 08:19:35
@@ -108,8 +108,8 @@
 #	at post-install time.
 #
 # RCD_SCRIPTS works lists the basenames of the rc.d scripts.  It's assumed=
 that
-#	they live in ${PREFIX}/etc/rc.d, and the scripts will be copied into
-#	${RCD_SCRIPTS_DIR} with ${RCD_SCRIPTS_MODE} permissions.
+#	they live in ${PREFIX}/share/examples/rc.d, and the scripts will be
+#	copied into ${RCD_SCRIPTS_DIR} with ${RCD_SCRIPTS_MODE} permissions.
 #
 CONF_FILES?=3D		# empty
 CONF_FILES_MODE?=3D	0644
@@ -119,7 +119,7 @@
 SUPPORT_FILES_PERMS?=3D	# empty
 RCD_SCRIPTS?=3D		# empty
 RCD_SCRIPTS_MODE?=3D	0755
-RCD_SCRIPTS_DIR?=3D	/etc/rc.d
+RCD_SCRIPTS_DIR?=3D	${PKG_SYSCONFBASE}/rc.d
 FILES_SUBST+=3D		CONF_FILES=3D${CONF_FILES:Q}
 FILES_SUBST+=3D		CONF_FILES_MODE=3D${CONF_FILES_MODE}
 FILES_SUBST+=3D		CONF_FILES_PERMS=3D${CONF_FILES_PERMS:Q}
@@ -127,8 +127,8 @@
 FILES_SUBST+=3D		SUPPORT_FILES_MODE=3D${SUPPORT_FILES_MODE}
 FILES_SUBST+=3D		SUPPORT_FILES_PERMS=3D${SUPPORT_FILES_PERMS:Q}
=20
-# Default to not installing the rc.d scripts automatically.
-INSTALL_RCD_SCRIPTS?=3D	NO
+# Default to install the rc.d scripts automatically.
+INSTALL_RCD_SCRIPTS?=3D	YES
 .if defined(INSTALL_RCD_SCRIPTS) && (${INSTALL_RCD_SCRIPTS} =3D=3D NO)
 FILES_SUBST+=3D		RCD_SCRIPTS=3D
 .else
Index: install/deinstall
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/pkgsrc/mk/install/deinstall,v
retrieving revision 1.8
diff -u -u -r1.8 deinstall
--- deinstall	2001/11/26 20:37:39	1.8
+++ deinstall	2002/05/23 08:19:42
@@ -31,7 +31,7 @@
 eval set -- ${RCD_SCRIPTS}
 for script
 do
-	samplefile=3D"${PKG_PREFIX}/etc/rc.d/${script}"
+	samplefile=3D"${PKG_PREFIX}/share/examples/rc.d/${script}"
 	file=3D"${RCD_SCRIPTS_DIR}/${script}"
 	shift
 	ALL_FILES=3D"${ALL_FILES} \"${samplefile}\" \"${file}\""
Index: install/install
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvsroot/pkgsrc/mk/install/install,v
retrieving revision 1.8
diff -u -u -r1.8 install
--- install	2002/01/23 15:02:27	1.8
+++ install	2002/05/23 08:19:42
@@ -156,7 +156,7 @@
 	eval set -- ${RCD_SCRIPTS}
 	for script
 	do
-		samplefile=3D"${PKG_PREFIX}/etc/rc.d/${script}"
+		samplefile=3D"${PKG_PREFIX}/share/examples/rc.d/${script}"
 		file=3D"${RCD_SCRIPTS_DIR}/${script}"
=20
 		if [ -e "${file}" ]

--mP3DRpeJDSE+ciuQ--

--cvVnyQ+4j833TQvp
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (NetBSD)

iD8DBQE87Keazz00ZOPKycwRAq9tAJ9/tDuILI3cs1+t3yxVm7KGzaorlgCgmFKz
W6NAQIqg9c4KXj3kmU2XJf0=
=Fxhk
-----END PGP SIGNATURE-----

--cvVnyQ+4j833TQvp--