Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Sep 1995 00:53:12 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        asami@cs.berkeley.edu, hackers@freebsd.org, ports@freebsd.org
Subject:   Re: ports startup scripts
Message-ID:  <199509201453.AAA00784@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199509201453.AAA00784>