From owner-freebsd-questions Mon May 5 14:17:12 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id OAA20884 for questions-outgoing; Mon, 5 May 1997 14:17:12 -0700 (PDT) Received: from speedbump.datapark.com (ns1.datapark.com [207.102.240.10]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id OAA20877 for ; Mon, 5 May 1997 14:17:08 -0700 (PDT) Received: from k2 (k2.datapark.com [207.102.240.32]) by speedbump.datapark.com (8.8.5/8.6.12) with SMTP id OAA01400; Mon, 5 May 1997 14:18:56 -0700 (PDT) Message-ID: <336E4E48.BEC@datapark.com> Date: Mon, 05 May 1997 14:16:56 -0700 From: Jeff Newton Organization: Tantalus Communications X-Mailer: Mozilla 3.0 (X11; I; SunOS 5.5.1 sun4u) MIME-Version: 1.0 To: freebsd-questions@FreeBSD.ORG CC: Daniel Zborovski Subject: Re: running a program on startup References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Dan Busarow wrote: > > On Mon, 5 May 1997, Daniel Zborovski wrote: > > Is there a way to run a program on startup. As it is now everytime I > > want to start my apache server I need to type: > > > > /usr/local/apache_1.1.1/src/httpd -f > > /usr/local/apache_1.1.1/conf/http.conf > > For 2.1.5R and up, create the directory > > /usr/local/etc/rc.d > > When the system boots it looks for files with a .sh extension > in this directory and executes them. So you want to create > a file named /usr/local/etc/rc.d/apache.sh containing > > #!/bin/sh > /usr/local/apache_1.1.1/src/httpd -f /usr/local/apache_1.1.1/conf/http.conf > > Chmod +x it and you are all set. > Or simply add /usr/local/apache_1.1.1/src/httpd -f to /etc/rc.local Creating a /usr/local/etc/rc.d directory and seperate scripts is perhaps a little cleaner (sys V style) but I find /etc/rc.local just as managable. Cheers, -- Jeff Newton Network Administrator Tantalus Communications Datapark Advanced Communications (604) 664-7454 ----------------- "It's the world, not a call I can screen out"- Headstones