Date: Mon, 1 Sep 2003 18:18:47 +0200 From: Andreas Klemm <andreas@FreeBSD.org> To: ports@FreeBSD.org Subject: start/stop script woes: ./squid.sh: Cannot determine the PREFIX Message-ID: <20030901161847.GA4451@titan.klemm.apsfilter.org>
next in thread | raw e-mail | index | archive | help
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@titan[ttyp2]{211} /usr/local/etc/rc.d ./squid.sh start ./squid.sh: Cannot determine the PREFIX Exit 1 Even `pwd`/squid.sh is PITA. And all because of arrangement like this which I very dislike in the meantime: #!/bin/sh if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then echo "$0: Cannot determine the PREFIX" >&2 exit 1 fi [...] 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 ? -> http://www.apsfilter.org/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030901161847.GA4451>