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

Andreas Klemm andreas at FreeBSD.org
Mon Sep 1 21:56:39 PDT 2003


On Tue, Sep 02, 2003 at 04:18:38AM +0400, Sergey Matveychuk wrote:
> Andreas Klemm wrote:
> >#!/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 ;-)
> 
> I'm sharing your feelings. I've found it quite uncomfortable.
> 
> >Q: Can we get rid of that and hardcode the paths in start stop
> >scripts so that they can be called without complete path ?
> 
> I think we need ask adrian@ to do so.

I put him on Cc:

Adrian, do you see a possibility to revamp all ports, that
have this PREFIX trickery in it ?

Additionally, some ports like ntop install their start stop script
without execute bit. Then the port doesn't startup when booting.
Since we already have a mechanism to disable a port by installing
it with a ".sample" or such appended I think there is no need to
add a new scheme. What about parsing the pkg file and setting the
x bit by finding out, what the start/stop script is, no matter what
the port maintainer "forgot" ?

	Andreas ///

-- 
Andreas Klemm - Powered by FreeBSD 5.1-CURRENT
Need a magic printfilter today ? -> http://www.apsfilter.org/


More information about the freebsd-ports mailing list