/usr/local/etc/rc.d/apache.sh question

2001-12-27 Thread Peter/Los Angeles, CA

Hello,

I have some understanding of how the script works, but I'm not sure what
it's asking for.

[09:37][root@interim:/usr/local/etc/rc.d]# ls
apache.sh*
[09:37][root@interim:/usr/local/etc/rc.d]# ./apache.sh start
./apache.sh: Cannot determine the PREFIX

That's what I get.  The following will be the contents of 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

Can someone please help?  If I type apachectl as I usually have done in
Linux, it works, but now this is asking me for something.  Can someone
please help?


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-stable in the body of the message



Re: /usr/local/etc/rc.d/apache.sh question

2001-12-27 Thread Sergey A. Osokin

On Thu, Dec 27, 2001 at 09:38:40AM -0800, Peter/Los Angeles, CA wrote:
 Hello,
 
 I have some understanding of how the script works, but I'm not sure what
 it's asking for.
 
 [09:37][root@interim:/usr/local/etc/rc.d]# ls
 apache.sh*
 [09:37][root@interim:/usr/local/etc/rc.d]# ./apache.sh start
 ./apache.sh: Cannot determine the PREFIX

Looks like you must use full path for this shell-script.
Like this:
[09:37][root@interim:/usr/local/etc/rc.d]# /usr/local/etc/rc.d/apache.sh start
-- 

Rgdz,/\ 
Sergey Osokin aka oZZ,   \ /  ASCII RIBBON CAMPAIGN
[EMAIL PROTECTED]X AGAINST HTML MAIL
http://freebsd.org.ru/~osa/  / \

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-stable in the body of the message



Re: /usr/local/etc/rc.d/apache.sh question

2001-12-27 Thread Alson van der Meulen

Peter/Los Angeles, CA([EMAIL PROTECTED])@2001.12.27 09:38:40 +:
 Hello,
 
 I have some understanding of how the script works, but I'm not sure what
 it's asking for.
 
 [09:37][root@interim:/usr/local/etc/rc.d]# ls
 apache.sh*
 [09:37][root@interim:/usr/local/etc/rc.d]# ./apache.sh start
 ./apache.sh: Cannot determine the PREFIX
try /usr/local/etc/rc.d/apache.sh start

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-stable in the body of the message



Re: /usr/local/etc/rc.d/apache.sh question

2001-12-27 Thread Peter/Los Angeles, CA

You guys are great.  Thanks a lot.

I owe you guys my first born.

Peter
- Original Message -
From: H. Wade Minter [EMAIL PROTECTED]
To: Peter/Los Angeles, CA [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, December 27, 2001 9:43 AM
Subject: Re: /usr/local/etc/rc.d/apache.sh question


 On Thu, 27 Dec 2001, Peter/Los Angeles, CA wrote:

  I have some understanding of how the script works, but I'm not sure what
  it's asking for.
 
  [09:37][root@interim:/usr/local/etc/rc.d]# ls
  apache.sh*
  [09:37][root@interim:/usr/local/etc/rc.d]# ./apache.sh start
  ./apache.sh: Cannot determine the PREFIX
 
  That's what I get.  The following will be the contents of apache.sh:

 It determines the PREFIX by the full path you use to call the script.  If
 you run:

 /usr/local/etc/rc.d/apache.sh start

 it will work.

 --Wade




To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-stable in the body of the message



Re: /usr/local/etc/rc.d/apache.sh question

2001-12-27 Thread Peter/Los Angeles, CA

Thanks.
- Original Message -
From: Josh Tolbert [EMAIL PROTECTED]
To: Peter/Los Angeles, CA [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, December 27, 2001 10:05 AM
Subject: Re: /usr/local/etc/rc.d/apache.sh question


 Peter,
 Take a look at what the script is doing. It's checking to see if
 execution was started with a full path (/usr/local/etc/rc.d/apache.sh)
 instead of a relative path (./apache.sh).
 When you run apachectl (startssl, I suspect), apachectl asks for
 whatever passphrase you used to encrypt the SSL key.

 Good luck,
 Josh

 On Thu, 27 Dec 2001, Peter/Los Angeles, CA wrote:

  Hello,
 
  I have some understanding of how the script works, but I'm not sure what
  it's asking for.
 
  [09:37][root@interim:/usr/local/etc/rc.d]# ls
  apache.sh*
  [09:37][root@interim:/usr/local/etc/rc.d]# ./apache.sh start
  ./apache.sh: Cannot determine the PREFIX
 
  That's what I get.  The following will be the contents of 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
 
  Can someone please help?  If I type apachectl as I usually have done in
  Linux, it works, but now this is asking me for something.  Can someone
  please help?
 
 
  To Unsubscribe: send mail to [EMAIL PROTECTED]
  with unsubscribe freebsd-stable in the body of the message
 




To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-stable in the body of the message