Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Oct 2001 13:29:06 -0700
From:      "george" <george@vagner.com>
To:        <questions@freebsd.org>
Subject:   apache.sh PREFIX problem
Message-ID:  <000801c15101$138dc5c0$0100a8c0@thunderbird>

index | next in thread | raw e-mail

[-- Attachment #1 --]
I can start apache manually but my installled apache.sh wont start it 
it pukes on

laptop# ./apache.sh
./apache.sh: Cannot determine the PREFIX
laptop#


here is the apache.sh file that was installed using the ports.
I suspect its something in that "\(/.*\)/etc mess but i am not a scripter and
have no idea what to put in there or take out for that matter...





laptop# cat apache.sh
#!/bin/sh

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

case "$1" in
start)
        [ -x ${PREFIX}/sbin/apachectl ] && ${PREFIX}/sbin/apachectl start > /dev
/null && echo -n ' apache'
        ;;
stop)
        [ -r /var/run/httpd.pid ] && ${PREFIX}/sbin/apachectl stop > /dev/null &
& echo -n ' apache'
        ;;
*)
        echo "Usage: `basename $0` {start|stop}" >&2
        ;;
esac

exit 0

[-- Attachment #2 --]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I can start apache manually but my installled 
apache.sh wont start it </FONT></DIV>
<DIV><FONT face=Arial size=2>it pukes on</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>laptop# ./apache.sh<BR>./apache.sh: Cannot 
determine the PREFIX<BR>laptop#</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>here is the apache.sh file that was installed using 
the ports.</FONT></DIV>
<DIV><FONT face=Arial size=2>I suspect its something in that "\(/.*\)/etc mess 
but i am not a scripter and</FONT></DIV>
<DIV><FONT face=Arial size=2>have no idea what to put in there or take out for 
that matter...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>laptop# cat apache.sh<BR>#!/bin/sh</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>if ! PREFIX=$(expr $0 : 
"\(/.*\)/etc/rc\.d/$(basename $0)\$"); then<BR>&nbsp;&nbsp;&nbsp; echo "$0: 
Cannot determine the PREFIX" &gt;&amp;2<BR>&nbsp;&nbsp;&nbsp; exit 
1<BR>fi</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>case "$1" 
in<BR>start)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ -x 
${PREFIX}/sbin/apachectl ] &amp;&amp; ${PREFIX}/sbin/apachectl start &gt; 
/dev<BR>/null &amp;&amp; echo -n ' 
apache'<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
;;<BR>stop)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ -r 
/var/run/httpd.pid ] &amp;&amp; ${PREFIX}/sbin/apachectl stop &gt; /dev/null 
&amp;<BR>&amp; echo -n ' apache'<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
;;<BR>*)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "Usage: `basename 
$0` {start|stop}" &gt;&amp;2<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
;;<BR>esac</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>exit 0</FONT></DIV></BODY></HTML>
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000801c15101$138dc5c0$0100a8c0>