From owner-freebsd-questions Mon May 5 16:30:53 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id QAA27544 for questions-outgoing; Mon, 5 May 1997 16:30:53 -0700 (PDT) Received: from tok.qiv.com ([204.214.141.211]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id QAA27539 for ; Mon, 5 May 1997 16:30:51 -0700 (PDT) Received: (from uucp@localhost) by tok.qiv.com (8.8.5/8.8.5) with UUCP id SAA01617 for freebsd-questions@freebsd.org; Mon, 5 May 1997 18:30:47 -0500 (CDT) Received: from localhost (jdn@localhost) by acp.qiv.com (8.8.5/8.8.5) with SMTP id SAA03936 for ; Mon, 5 May 1997 18:21:33 -0500 (CDT) X-Authentication-Warning: acp.qiv.com: jdn owned process doing -bs Date: Mon, 5 May 1997 18:21:32 -0500 (CDT) From: "Jay D. Nelson" To: freebsd-questions@freebsd.org Subject: Re: running a program on startup In-Reply-To: <336E4E48.BEC@datapark.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I use rc.local, even on SYSV machines -- I guess because I'm too old or stubborn to change. I like it. But now, everyone says it's deprecated. Does anyone know why? -- Jay On Mon, 5 May 1997, Jeff Newton wrote: ->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 ->