start/stop script woes: ./ Cannot determine the PREFIX

Andreas Klemm andreas at
Mon Sep 1 09:20:20 PDT 2003

Hi fellows,

again I trapped over this (and this many times in the last 1-2 years),
when this kind of start-stop script methodology had been introduced
to the ports tree.

Its really not very comfortable having to call the start/stop scripts
with the complete path.

root at titan[ttyp2]{211} /usr/local/etc/rc.d ./ start
./ Cannot determine the PREFIX
Exit 1

Even `pwd`/ is PITA.
And all because of arrangement like this which I very dislike
in the meantime:


if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
    echo "$0: Cannot determine the PREFIX" >&2
    exit 1

I don't know if you share my feelings about that ;-)

It would be much more comfortable, if the ports would patch the
prefix into the start/stop-script during installation of the port,
like other ports hopefully still do.

I think this only has been coded this way for "coolness sake",
but not really for functionality for the admins, who need it
from time from time.

I trapped over this so many times, but this time I wanted to
bring this up on -ports ;-)

Q: Can we get rid of that and hardcode the paths in start stop
scripts so that they can be called without complete path ?

	Andreas ///

Andreas Klemm - Powered by FreeBSD 5.1-CURRENT
Need a magic printfilter today ? ->

More information about the freebsd-ports mailing list