From owner-freebsd-ports@FreeBSD.ORG Mon Sep 1 09:20:20 2003 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5B5AD16A4BF for ; Mon, 1 Sep 2003 09:20:20 -0700 (PDT) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id B1CA043FA3 for ; Mon, 1 Sep 2003 09:20:18 -0700 (PDT) (envelope-from andreas@klemm.apsfilter.org) Received: from srv1.cosmo-project.de (localhost [IPv6:::1]) by srv1.cosmo-project.de (8.12.9/8.12.9) with ESMTP id h81GKEUf094125 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 1 Sep 2003 18:20:15 +0200 (CEST) (envelope-from andreas@klemm.apsfilter.org) Received: (from uucp@localhost)h81GKDv9094124 for ports@FreeBSD.org; Mon, 1 Sep 2003 18:20:13 +0200 (CEST) (envelope-from andreas@klemm.apsfilter.org) Received: from titan.klemm.apsfilter.org (localhost.klemm.apsfilter.org [127.0.0.1]) by klemm.apsfilter.org (8.12.9/8.12.9) with ESMTP id h81GIl6q004602 for ; Mon, 1 Sep 2003 18:18:52 +0200 (CEST) (envelope-from andreas@titan.klemm.apsfilter.org) Received: (from andreas@localhost) by titan.klemm.apsfilter.org (8.12.9/8.12.9/Submit) id h81GIlU7004600 for ports@FreeBSD.org; Mon, 1 Sep 2003 18:18:47 +0200 (CEST) Date: Mon, 1 Sep 2003 18:18:47 +0200 From: Andreas Klemm To: ports@FreeBSD.org Message-ID: <20030901161847.GA4451@titan.klemm.apsfilter.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD 5.1-CURRENT X-Disclaimer: A free society is one where it is safe to be unpopular User-Agent: Mutt/1.5.4i Subject: start/stop script woes: ./squid.sh: Cannot determine the PREFIX X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Sep 2003 16:20:20 -0000 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/