From owner-freebsd-questions Tue Apr 16 4:36:58 2002 Delivered-To: freebsd-questions@freebsd.org Received: from rwcrmhc54.attbi.com (rwcrmhc54.attbi.com [216.148.227.87]) by hub.freebsd.org (Postfix) with ESMTP id 086CC37B416 for ; Tue, 16 Apr 2002 04:36:52 -0700 (PDT) Received: from max ([24.61.57.241]) by rwcrmhc54.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020416113652.DYEK15826.rwcrmhc54.attbi.com@max> for ; Tue, 16 Apr 2002 11:36:52 +0000 Message-ID: <200204160736570383.220A6DAD@mail.attbi.com> In-Reply-To: References: X-Mailer: Calypso Version 3.30.00.00 (4) Date: Tue, 16 Apr 2002 07:36:57 -0400 Reply-To: jdarnold@buddydog.org From: "Jonathan Arnold" To: freebsd-questions@FreeBSD.ORG Subject: Re: stupid question - safe way to start apache in rc.d Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >I have compiled apache from source (so that I can do customisations and= the >like) and would like it to start at boot time, what sort of script should= I When I did that, it automagically put the startup script into rc.d. Did you check to see if it was already there? Anyway, here's the script it put in there: =3D=3D=3D cut here =3D=3D=3D #!/bin/sh if ! PREFIX=3D$(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 -- Jonathan Arnold (mailto:jdarnold@buddydog.org) Daemon Dancing in the Dark, a FreeBSD weblog: http://jdarnold.tzo.com/FreeBSD To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message