From owner-freebsd-ports Wed Sep 20 07:59:17 1995 Return-Path: owner-ports Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id HAA04759 for ports-outgoing; Wed, 20 Sep 1995 07:59:17 -0700 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.34]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id HAA04752 ; Wed, 20 Sep 1995 07:59:05 -0700 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id AAA00784; Thu, 21 Sep 1995 00:53:12 +1000 Date: Thu, 21 Sep 1995 00:53:12 +1000 From: Bruce Evans Message-Id: <199509201453.AAA00784@godzilla.zeta.org.au> To: asami@cs.berkeley.edu, hackers@freebsd.org, ports@freebsd.org Subject: Re: ports startup scripts Sender: owner-ports@freebsd.org Precedence: bulk >to be run from /etc/rc. The question is, where do we want that >"local_startup" directory to be? Are symlinks to a variable location too ugly/unmanageable? Double links could be used as both as documentation and to avoid moving directories out of the way. E.g., for the current problem: - /etc/rc always references /links/local_startup - /links/local_startup is a link to either /etc/rc.d or /usr/local/etc/rc.d, depending on locally best solutions to the configuration problems mentioned in (1)-(2): >(1) /etc/rc.d > - Ports shouldn't touch anything in the root filesystem > + Central location, easy to maintain > + Per-machine configuration possible even if /usr/local is NFS shared >(2) /usr/local/etc/rc.d > - Shouldn't fix certain location > - If /usr/local is NFS shared, per-machine configuration is cumbersome >(3) Same as (2), but use the regular ${PREFIX} (defined as /usr/local > in bsd.port.mk) Ideally, all prefixes and paths should be found in one place. /links would be a reasonably dynamic place - use readlink() to look it up and standard utilities to manipulate it. The links could be followed directly or cached by programs. E.g., `make' could look up /links/bshell (which would normally point to /bin/sh) once and use the result several times. >That leaves option (4). We can deal with multiple startup dirs >easily, just a couple more lines of shell programming. And to >alleviate the second problem, I propose the following: > @ Define LOCAL_PREFIX and X11BASE in /etc/sysconfig > @ In /etc/rc, add a line that generates a file somewhere in /var > (say, /var/run/paths) with the contents: >... readlink() isn't as convenient an interface for some purposes as a list of variables, but this list could be created easily by `ls -l /links | sed ... | grep ...' >/var/run/paths. Bruce