Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Oct 2001 22:58:19 +0100
From:      Kevin Golding <kevin@caomhin.demon.co.uk>
To:        george <george@vagner.com>
Cc:        questions@freebsd.org
Subject:   Re: apache.sh PREFIX problem
Message-ID:  <IbOWFCB7L3w7EwE0@caomhin.demon.co.uk>
In-Reply-To: <001a01c1510a$52158770$0100a8c0@thunderbird>
References:  <000801c15101$138dc5c0$0100a8c0@thunderbird> <bqwCp1AAF2w7EwU2@caomhin.demon.co.uk> <001a01c1510a$52158770$0100a8c0@thunderbird>

next in thread | previous in thread | raw e-mail | index | archive | help
In message <001a01c1510a$52158770$0100a8c0@thunderbird>, george
<george@vagner.com> writes
>I couldnt figure out all that case stuff so I made my own script
>I tried to run the commented out version you sent but I was still getting
>and error below is what i came up with
>
>
>what do you think?

Erm, well if it works then hey, but I'd be a little surprised if it did.  

The case stuff you left out is the start and stop signal.  Basically you
just want to remove the if statement at the top and put the path in
yourself to replace the ${PREFIX} throughout the script. It's not the
prettiest solution I admit but it should work.  

It means you're basically just doing the search for where apachectl is
by yourself.  If you still have trouble after that then you need more
help than I can manage. :-)

Kevin,
      kludgey but working :-)

>laptop# cat apache.sh
>
>#!/bin/sh
>
>if      [ -x /usr/local/sbin/apachectl ]
>then     /usr/local/sbin/apachectl start > /dev/null && echo -n ' apache'
>fi
>if      [ -r /var/run/httpd.pid ]
>then    /usr/local/sbin/apachectl stop > /dev/null && echo -n ' apache'
>fi
>laptop#
>
>----- Original Message ----- 
>From: "Kevin Golding" <kevin@caomhin.demon.co.uk>
>To: "george" <george@vagner.com>
>Sent: Tuesday, October 09, 2001 1:42 PM
>Subject: Re: apache.sh PREFIX problem
>
>
>> In message <000801c15101$138dc5c0$0100a8c0@thunderbird>, george
>> <george@vagner.com> writes
>> >    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...
>> 
>> A script guru will probably suggest something better but this will work:
>> 
>> 
>> #!/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 usr/local/sbin/apachectl ] && /usr/local/sbin/apachectl 
>>     start > /dev
>>     /null && echo -n ' apache'
>>     ;;
>>     stop)
>>     [ -r /var/run/httpd.pid ] && /usr/local/sbin/apachectl stop 
>>     > /dev/null &
>>     & echo -n ' apache'
>>     ;;
>>     *)
>>     echo "Usage: `basename $0` {start|stop}" >&2
>>     ;;
>>     esac
>>     
>>     exit 0
>> 
>> 
>> Basically your prefix is most likely /usr/local if you installed from
>> ports, if you're starting manually you know this :-)


-- 
kevin@caomhin.demon.co.uk

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?IbOWFCB7L3w7EwE0>